sr320 / ceabigr

Workshop on genomic data integration with a emphasis on epigenetic data (FHL 2022)
4 stars 2 forks source link

awk code for replacing loci %meth where snp with 0 #33

Closed shellywanamaker closed 2 years ago

shellywanamaker commented 2 years ago

@yaaminiv

awk -F"\t" 'NR==FNR{a[$1,$2]=$1"\t"$2;next}(if($1"\t"$2) in a){print $1"\t"$2"\t"$3"\t"0;else print $0}' .vcf .bedgraph

github-actions[bot] commented 2 years ago

We all like issues! And you just posted your first to CEABiGR - congrats!.

yaaminiv commented 2 years ago

awk -F"\t" 'NR==FNR{a[$1"\t"$2]=$1"\t"$2;next}{if(($1"\t"$2) in a) print $1"\t"$2"\t"$3"\t"0;else print $0}' \ 3F_R1_val_1_bismark_bt2_pe.SNP-results.vcf \ 3F_R1_val_1_10x.sort.bedgraph

it works!!