Seqanswers Leaderboard Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • chrisbala
    Member
    • Jan 2010
    • 82

    Subsampling Fastq

    Anyone know an easy way to randomly subsample from a fastq (Illumina data)?

    ShortReads seems to have a function FastqSampler, but I can't seem to make it work (?FastqSampler gives No documentation for 'FastqSampler' in specified packages and libraries:
    you could try '??FastqSampler')

    Thanks!

    Chris
  • Zigster
    Jeremy Leipzig
    • May 2009
    • 116

    #2
    i don't think you loaded ShortRead
    start R
    > R
    in R:
    > install.packages("ShortRead")
    > library("ShortRead")
    > ?FastqSampler
    --
    Jeremy Leipzig
    Bioinformatics Programmer
    --
    My blog
    Twitter

    Comment

    • chrisbala
      Member
      • Jan 2010
      • 82

      #3
      haha, I'm a bit of a newbie but not quite THAT bad...

      I was testing it out on my Mac/GUI version of R. That does not seem to work.

      Linux version seems fine. Maybe I'm still missing something ... but thats my guess as to what was going on.

      Thanks though!

      Comment

      • chrisbala
        Member
        • Jan 2010
        • 82

        #4
        exporting

        Ok, followup question...

        Once I've done

        Code:
        donkey <- FastqSampler(con, n=1e6, readerBlockSize=1e8, verbose=FALSE)
        How do I write the sampled sequences to a fastq file?

        THanks, and apologies if this obvious.

        Chris

        Comment

        • ewilbanks
          Member
          • Mar 2009
          • 83

          #5
          You can also use the mothur package which has a similar subsampling feature. The examples shows fasta only but I think it can handle paired fasta/qual files.

          Comment

          • pbseq
            Member
            • Feb 2010
            • 16

            #6
            Hi chrisbala,
            in ShortRead package ( manual :

            )

            there is writeFastq method that looks like what you need:
            from manual:

            writeFastq signature(object = "ShortReadQ", file = "character", mode="character",
            ...): Write object to file in fastq format. mode defaults to ‘w’. This creates a new
            file, or fails if file already exists. Use mode="a" to append to an existing file. file is
            expanded using path.expand.


            hope it helps
            Last edited by pbseq; 01-11-2011, 06:04 AM.

            Comment

            • shanebrubaker
              Member
              • Nov 2009
              • 13

              #7
              On a related note, I was trying to reduce my data size by using khmer, from a paper on Digitial Normalization. Does anyone have experience with this tool? I am getting an error when using it where it says I have no paired reads ... but I do. Are there simliar tools?

              Comment

              • westerman
                Rick Westerman
                • Jun 2008
                • 1104

                #8
                @shanebrubaker:

                I suspect that you will get a better response if you ask your questing in a different thread with a title that contains "Digital Normalization" instead of burying it inside this thread. As for the answer to your question, I do not know. I am just starting to explore the program and may find out the answer later today.

                Comment

                • chayan
                  Member
                  • Nov 2012
                  • 52

                  #9
                  i need to subsampling my fastq file of Iontorrent shotgun reads. I install R-2.15 and going by the previous suggesitios in this thread i tried to install ShortRead by > install.packages("ShortRead") but get the folowing error
                  Warning message:
                  In getDependencies(pkgs, dependencies, available, lib) :
                  package ‘Shortread’ is not available

                  ne help regarding this and if any other ways to random sampling of my fastq file. Thanx in advannce

                  Regards
                  Chayan

                  Comment

                  • GenoMax
                    Senior Member
                    • Feb 2008
                    • 7142

                    #10
                    Chayan: see this thread for other options in case the R solution does not work: http://seqanswers.com/forums/showthread.php?t=16505

                    Comment

                    Latest Articles

                    Collapse

                    • seqadmin
                      Pathogen Surveillance with Advanced Genomic Tools
                      by seqadmin




                      The COVID-19 pandemic highlighted the need for proactive pathogen surveillance systems. As ongoing threats like avian influenza and newly emerging infections continue to pose risks, researchers are working to improve how quickly and accurately pathogens can be identified and tracked. In a recent SEQanswers webinar, two experts discussed how next-generation sequencing (NGS) and machine learning are shaping efforts to monitor viral variation and trace the origins of infectious...
                      03-24-2025, 11:48 AM
                    • seqadmin
                      New Genomics Tools and Methods Shared at AGBT 2025
                      by seqadmin


                      This year’s Advances in Genome Biology and Technology (AGBT) General Meeting commemorated the 25th anniversary of the event at its original venue on Marco Island, Florida. While this year’s event didn’t include high-profile musical performances, the industry announcements and cutting-edge research still drew the attention of leading scientists.

                      The Headliner
                      The biggest announcement was Roche stepping back into the sequencing platform market. In the years since...
                      03-03-2025, 01:39 PM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, 03-20-2025, 05:03 AM
                    0 responses
                    42 views
                    0 reactions
                    Last Post seqadmin  
                    Started by seqadmin, 03-19-2025, 07:27 AM
                    0 responses
                    53 views
                    0 reactions
                    Last Post seqadmin  
                    Started by seqadmin, 03-18-2025, 12:50 PM
                    0 responses
                    39 views
                    0 reactions
                    Last Post seqadmin  
                    Started by seqadmin, 03-03-2025, 01:15 PM
                    0 responses
                    194 views
                    0 reactions
                    Last Post seqadmin  
                    Working...