Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Usage of SAM-JDK

    Hi all,

    I am having trouble understanding how to use SAM-JDK.

    For example. My Java class needs to filter an input SAM or BAM file to remove all unaligned reads. Commandline, I would use:
    Code:
    ViewSam.jar ALIGNMENT_STATUS=Aligned I=alignment.bam
    But how do I do this directly in my class?

    I have been looking at the docs (http://picard.sourceforge.net/javadoc/) and browsed the mailing list archives and this forum (and I have seen the code example here). However I still have no idea where to start.

    Does anyone have any idea how to address this? Is there some more documentation, or an experienced user to help me on my way?

    Many thanks,

    Wil

  • #2
    Originally posted by Bruins View Post
    Hi all,

    I am having trouble understanding how to use SAM-JDK.

    For example. My Java class needs to filter an input SAM or BAM file to remove all unaligned reads. Commandline, I would use:
    Code:
    ViewSam.jar ALIGNMENT_STATUS=Aligned I=alignment.bam
    But how do I do this directly in my class?

    I have been looking at the docs (http://picard.sourceforge.net/javadoc/) and browsed the mailing list archives and this forum (and I have seen the code example here). However I still have no idea where to start.

    Does anyone have any idea how to address this? Is there some more documentation, or an experienced user to help me on my way?

    Many thanks,

    Wil
    Does this help?

    -drd

    Comment


    • #3
      I'm sorry, no. Thanks for the quick reply though. The page you gave me has already helped me a lot but explains only how to use the executable jars from the commandline.

      To clarify what I am looking for, here a very minimal code example.
      Code:
      public class FilterAndSort {
      
          [...]
      
          // the method: filter all unaligned reads from a SAM or BAM file
          // @param bamfile the location of a BAM or SAM file as a string
          // @return filteredBamfile the location of the new filtered BAM or SAM file as a string
          private String reportAlignedReads(String bamfile) {
      This is the point where I would like to utilise the ViewSam.jar functionality, but without having to make a commandline call from within my class. Luckily, SAM-JDK exists.

      The code example (this one) shows how to access a SAM or BAM file. I am unsure how to use it and the other classes and methods available in the javadoc (both net.sf.picard and net.sf.samtools) to filter out the unaligned reads - I don't know where to start.

      For example. The javadoc shows that the ViewSam class has constructor ViewSam() and two methods: a main method and a method called doWork() that 'does work after command line has been parsed'. Something tells me I am not supposed to use this class. But what other class...

      Code:
              return filteredBamfile;
          }
      }
      I hope I'm not asking anything completely obvious... if so please tell me... because I get the feeling that I am mixing up things here, the Picard commandline tools and SAM-JDK.

      Many thanks,
      Wil

      *** edit
      Read the thread on the quality of posts (here). I was already unsure whether asking this question was inappropriate or not... So here how I feel about my own question:
      - very sorry if it's silly
      - I am very fond of SAMtools, don't get me wrong!
      - I'd rather not bother the developers with this if it does turn out to be a very silly question. That is why I turn to this forum.
      - and most importantly: a major thanks to all who take the time to read my questions, think about them and reply to them!
      Last edited by Bruins; 05-27-2010, 12:47 AM.

      Comment

      Latest Articles

      Collapse

      • seqadmin
        Essential Discoveries and Tools in Epitranscriptomics
        by seqadmin




        The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
        04-22-2024, 07:01 AM
      • seqadmin
        Current Approaches to Protein Sequencing
        by seqadmin


        Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
        04-04-2024, 04:25 PM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Today, 08:06 AM
      0 responses
      11 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-30-2024, 12:17 PM
      0 responses
      14 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-29-2024, 10:49 AM
      0 responses
      19 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-25-2024, 11:49 AM
      0 responses
      26 views
      0 likes
      Last Post seqadmin  
      Working...
      X