Randomly filtering reads from two sam files
Hi,
I have these two sam files hg19.sam and hg38.sam. I would like to randomly sample entries from hg19.sam (for each entry, include it with probability 0.5) and randomly sample entries from hg38.sam and merge these entries into one sam file: merged.sam. How should I best go about this? Thanks!
• 2,660 views
•
link
1 answer
samtools view -sallows you to subsample sam files followed bysamtools mergeto merge them.- Also, sambamba is very fast. Same thing,
sambamba -sfor subsampling andsambamba mergefor merging - Picard tools allows you to do the same too.
You can also do the same with a simple python/perl/shell (using shuf) scripts if you want.
• 0 views
•
link
Log in to answer this question.
what's the point of this ? the chromosomes length/name/sequence are not the same ....
Later that week:
Later that year: