etal / cnvkit

Copy number variant detection from targeted DNA sequencing
http://cnvkit.readthedocs.org
Other
545 stars 165 forks source link

How to loop over samples cnvkit.py batch #754

Open AndreaG5 opened 2 years ago

AndreaG5 commented 2 years ago

Hi, I found the batch method very useful to complete the cnv pipeline computation. I'm working with WES data, so I do not have "tumor" or "normal" bams, but with few try I found a clearer and less noisy result avoiding the ref flat but instead treating alternatively samples as tumor or normal. I wanted to know if there's a chance to loop over samples, considering one at time as tumor and the rest of them as normal, iteratively, in a build-in function.

Thank you

SouzaBB commented 2 years ago

What I do is first build the reference with all samples I have and then use a simple for loop to perform analysis by sample against the reference created

AndreaG5 commented 2 years ago

Thank you! I thought about it, but doing some try I found results noisier and less clear than treating samples as tumor and normal.

SouzaBB commented 2 years ago

I guess I wasn't so clear in my answer. I use the same samples as Normal and Tumor as well... My loop starts building the reference with all samples from the same sequencing being considered as normal, then I use rename to change the same samples from ${i}.Normal.bam to {i}.Tumor.bam. At this point, I'll call sample by sample in a for loop to analyze each sample against the reference.

AndreaG5 commented 2 years ago

Oh I'm sorry I didn't get your point! This is way clearer! Thank you so much for the hint! Have a good day