Skip to content

Instantly share code, notes, and snippets.

View faithman's full-sized avatar
💭
leanring

Ye Wang faithman

💭
leanring
  • Chengdu Research Base of Giant Panda Breeding
  • Chengdu, China
View GitHub Profile
#!/usr/bin/env bash
set -x
set -e
DBNAME=chicken_new
GTF=/projects/b1059/projects/Ye/snpEff/data/Chicken.GRCg6a/genes.gtf.gz
FASTA=/projects/b1059/projects/Ye/snpEff/data/Chicken.GRCg6a/sequences.fa
CDS=/projects/b1059/projects/Ye/snpEff/data/Chicken.GRCg6a/cds.fa.gz
sed 'N;s/\n/ /'
paste -d " " - -
awk 'NR%2{printf "%s ",$0;next;}1' yourFile
@faithman
faithman / use awk to do left join
Created June 13, 2019 14:59
use awk to do left join
awk 'NR==FNR{a[$1]=$0;next}{print $0 FS (a[$1]?a[$1]:"missing")}' WI-info-google_sheet.sort.tsv sample_info_for_join.tsv
parallel --verbose fastq-dump --split-files {} --outdir "/projects/b1059/projects/Ye/ch/downloaded_data/data" < download_list_v1.txt
cat file.bed | awk -F'\t' 'BEGIN{SUM=0}{ SUM+=$3-$2 }END{print SUM}'
awk '$5 ~ /(conservative_inframe_deletion|synonymous_variant|disruptive_inframe_deletion|disruptive_inframe_insertion|frameshift_variant|missense_variant|start_lost|stop_gained|stop_lost|5_prime_UTR_premature_start_codon_gain_variant)/'
for i in `cat N2_included.tsv` ; do
for j in `cat N2_included.tsv` ; do
if [ "$i" '<' "$j" ] ; then
echo ${i}-${j}
fi
done
done | tr "-" "\t"
for i in `cat N2_included.tsv` ; do
for j in `cat N2_included.tsv` ; do
if [ "$i" '<' "$j" ] ; then
echo ${i}-${j}
fi
done
done | tr "-" "\t"
awk 'NR==FNR{inFileA[$1]; next} ($1 in inFileA)' strain_for_data_set.tsv /projects/b1059/workflows/wi-nf/sample_sheet.tsv
@faithman
faithman / NLS_plot
Created February 2, 2018 22:40
and a nls fit for point plot
#input data
y = c(19,513,981,1386,1727,1998,2185,2301)
x = c(1,5,10,15,20,25,30,34)
#check data by graphing
plot(x,y)
#create data frame
data <- data.frame(y,x)
#fit nls model setting initial parameters phi1=max
fit_1<-nls(y~phi1/(1+exp(-(phi2+phi3*x))),start=list(phi1=3500,phi2=-1.096,phi3=.5),data=data,trace=TRUE)
summary(fit_1)