Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Brian Bushnell
    replied
    It's possible to do so with BBTools like this:

    reformat.sh in=file1.sam out=mapped1.sam mappedonly
    reformat.sh in=file2.sam out=mapped2.sam mappedonly


    That gets you the mapped reads only. Then:

    filterbyname.sh in=mapped1.sam names=mapped2.sam out=shared.sam include=t

    ...which gets you the set intersection;

    filterbyname.sh in=mapped1.sam names=mapped2.sam out=only1.sam include=f
    filterbyname.sh in=mapped2.sam names=mapped1.sam out=only2.sam include=f


    ...which get you the set subtractions.

    Leave a comment:


  • cmbetts
    replied
    If you can get the read names into two R character vectors, you could use the various set operations like setdiff.
    There's probably a much more elegant (and faster) way to do this, but quick and dirty:

    library("GenomicAlignments");
    reads_alnmt1 <- names(readGAlignments(bam_file1, use.names=TRUE));
    reads_alnmt2 <- names(readGAlignments(bam_file2, use.names=TRUE));

    unique1 <- setdiff(reads_alnmt1, reads_alnmt2);
    unique2 <- setdiff(reads_alnmt2, reads_alnmt1);

    Leave a comment:


  • Marisa_Miller
    started a topic Compare mapped reads in SAM/BAM files

    Compare mapped reads in SAM/BAM files

    Hello,

    I have two different SAM/BAM files for a sequenced library (Illumina library sequenced paired-end) which were generated by mapping the reads (with Bowtie2) to two different reference genomes. I would like to see how many mapped reads (can be mapped concordant or discordant, doesn't matter) are shared between the two alignment files and how many mapped reads are unique to one file or the other.

    Is there a tool available to do this, possibly in samtools? If not, does anyone have some suggestions to get me started on the right track?

    Thank you!

Latest Articles

Collapse

  • seqadmin
    Best Practices for Single-Cell Sequencing Analysis
    by seqadmin



    While isolating and preparing single cells for sequencing was historically the bottleneck, recent technological advancements have shifted the challenge to data analysis. This highlights the rapidly evolving nature of single-cell sequencing. The inherent complexity of single-cell analysis has intensified with the surge in data volume and the incorporation of diverse and more complex datasets. This article explores the challenges in analysis, examines common pitfalls, offers...
    06-06-2024, 07:15 AM
  • seqadmin
    Latest Developments in Precision Medicine
    by seqadmin



    Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

    Somatic Genomics
    “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
    05-24-2024, 01:16 PM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, Today, 08:58 AM
0 responses
8 views
0 likes
Last Post seqadmin  
Started by seqadmin, Yesterday, 02:20 PM
0 responses
14 views
0 likes
Last Post seqadmin  
Started by seqadmin, 06-07-2024, 06:58 AM
0 responses
181 views
0 likes
Last Post seqadmin  
Started by seqadmin, 06-06-2024, 08:18 AM
0 responses
229 views
0 likes
Last Post seqadmin  
Working...
X