Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bruins
    Member
    • Feb 2010
    • 78

    #1

    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
  • drio
    Senior Member
    • Oct 2008
    • 323

    #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?

    http://picard.sourceforge.net/comman...overview.shtml
    -drd

    Comment

    • Bruins
      Member
      • Feb 2010
      • 78

      #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

      • SEQadmin2
        Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
        by SEQadmin2



        Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

        Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
        ...
        10-14-2026, 09:55 AM
      • SEQadmin2
        New Genomics Technologies Take Aim at Long-Standing Limits
        by SEQadmin2


        Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

        We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
        ...
        09-28-2026, 10:25 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 10-22-2026, 11:13 AM
      0 responses
      38 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 10:48 AM
      0 responses
      28 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-15-2026, 10:52 AM
      0 responses
      41 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-14-2026, 05:39 AM
      0 responses
      45 views
      0 reactions
      Last Post SEQadmin2  
      Working...