shunliubio / eTAM-seq_workflow

A workflow for eTAM-seq data processing.
GNU General Public License v3.0
4 stars 2 forks source link

How to generate the count table with two replicates? #4

Closed llecompte closed 1 year ago

llecompte commented 1 year ago

Hello,

May I ask, how did you generate the count table with two replicates? For example for the two FTO- replicates vs the two FTO+ replicates. As I understand from the 3_run_model_ftop.R script, this count table must contain the following columns: pos","motif","type","ftom_G_1","ftom_A_1","ftom_G_2","ftom_A_2","ftop_G_1","ftop_A_1","ftop_G_2","ftop_A_2"

How did you perform the intersectBed with 4 .bed files?

intersectBed -wo -s -a ftom.rep1.pileup2var.flt.bed -b ftop.rep1.pileup2var.flt.bed | awk -F '\t' 'BEGIN {OFS="\t";print "pos","motif","type","ftom_G_count","ftom_A_count","ftop_G_count","ftop_A_count"} {split($4,a,"=");split($10,b,"=");print a[1],a[5],a[6],a[2],a[3],b[2],b[3]}' > ftom.ftop.rep1n1.pileup2var.flt.count.table.txt

Thank you very much for your help! Best,

Lolita

shunliubio commented 1 year ago

You can try the following code that might need a little bit more memory:

intersectBed -wo -s -a ftom.rep1.pileup2var.flt.bed -b ftom.rep2.pileup2var.flt.bed | intersectBed -wo -s -a - -b ftop.rep3.pileup2var.flt.bed | intersectBed -wo -s -a - -b ftop.rep4.pileup2var.flt.bed | awk -F '\t' 'BEGIN {OFS="\t";print "pos","motif","type","ftom_G_1","ftom_A_1","ftom_G_2","ftom_A_2","ftop_G_1","ftop_A_1","ftop_G_2","ftop_A_2"} {split($4,a,"=");split($10,b,"=");split($17,c,"=");split($24,d,"=");print a[1],a[5],a[6],a[2],a[3],b[2],b[3],c[2],c[3],d[2],d[3]}' > ftom.ftop.pileup2var.flt.count.table.txt

Note that it will generate a count table with common sites of all four samples.

llecompte commented 1 year ago

Thank you very much! Lolita