Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • #31
    @GenoMax, we suspected that our reads might be somehow corrupted during the ftp transer. We used fastQC to check for quality and trimming didn't seem necessary. I'm still exploring trying different tophat threds and options to speed up mapping. Thanks for your suggestions

    Comment


    • #32
      Originally posted by Ntobe View Post
      Thanks so much Brian Bushnell. The reason we trying to explore cleaning the reads is because our tophat jobs were running out of time in the server before completion. Our raw read files are too big (~13GB per .gz file) and we were thinking that some of the reads might not be of good quality. If that the case, why not remove them and map only good quality reads? Again, this might not be a good approach and that why I'm seeking help.
      You can quality-filter, but it will increase bias if you do it aggressively. Quality-trimming is a much better approach for quantitative analysis. Incidentally, BBMap is substantially faster than Tophat, and STAR is (from what I have heard) substantially faster than BBMap. Switching to a faster aligner would be a better approach than discarding enough of the data to finish in a fixed time window.

      Comment


      • #33
        Originally posted by simonandrews View Post
        If it's useful to anyone this is a small script I knocked up when we had to process some fastq files which were corrupted during an FTP transfer. You can pipe data through it and it does some basic sanity checks to ensure that the file looks like valid fastq data. It will remove any entries which look broken and leave you just the good stuff.

        Code:
        #!/usr/bin/perl
        use warnings;
        use strict;
        
        while (<>) {
        
          unless (/^\@/) {
            warn "$_ should have had an \@ at the start and it didn't\n";
            next;
          }
          my $id1 = $_;
          my $seq = <>;
          my $id2 = <>;
          my $qual = <>;
        
          if ($seq =~/^[@+]/) {
            warn "Sequence '$seq' looked like an id";
            next;
          }
          if ($qual =~/^[@+]/) {
            warn "Quality '$qual' looked like an id";
            next;
          }
          if ($id2 !~ /^\+/) {
            warn "Midline '$id2' didn't start with a +";
            next;
          }
        
          if ($qual =~ /[GATCN]{20,}/) {
            warn "Quality '$qual' looked like sequence";
            next;
          }
        
          if (length($seq) != length($qual)) {
            warn "Seq $seq and Qual $qual weren't the same length";
            next;
          }
        
          print $id1,$seq,$id2,$qual;
        
        
        }
        Hi,

        This is my lack of PERL shining through, but is there a way to get a two output files, one with the "good" reads and one with the "bad" reads?

        Thanks,
        Andor

        Comment


        • #34
          Save code below in a file (check.pl in this example) and then run as

          Code:
          $ perl check.pl input_seq.fq good.fq bad.fq
          Note: This code assumes that every fastq entry has 4 lines in the file. It does not check for gross problems (i.e. missing an entire line in a record). Use at your own risk, not extensively tested :-)

          -----------------------------------

          Code:
          #!/usr/bin/perl
          use warnings;
          use strict;
          
          my $infile = $ARGV[0];
          my $outfile1 = $ARGV[1];
          my $outfile2 = $ARGV[2];
          
          open (IN, "$infile") or die "can't open the outputfile: $infile\n";
          open (OUT1, ">$outfile1") or die "can't open the outputfile: $outfile1\n";
          open (OUT2, ">$outfile2") or die "can't open the outputfile: $outfile2\n";
          
          
          while (<>) {
          
            my $id1 = $_;
            my $seq = <>;
            my $id2 = <>;
            my $qual = <>;
            
            if ($id1 !~ /^[\@]/) {
                  print OUT2 $id1,$seq,$id2,$qual;
              next;
            }
          
            if ($seq !~ /[GATCN]+/g) {
                  print OUT2 $id1,$seq,$id2,$qual;
              next;
            }
            if ($id2 !~ /^\+/) {
                  print OUT2 $id1,$seq,$id2,$qual;
              next;
            }
          
            if (length($seq) != length($qual)) {
              warn "Seq $seq and Qual $qual weren't the same length";
                  print OUT2 $id1,$seq,$id2,$qual;
              next;
            }
          
            print OUT1 $id1,$seq,$id2,$qual;
          
          }
          close IN;
          close OUT1;
          close OUT2;
          Edit : The regex for base checking is not working so a record with sequence characters other than ACGTN will get through.
          Last edited by GenoMax; 07-26-2017, 03:12 PM.

          Comment

          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, 06-14-2024, 07:24 AM
          0 responses
          13 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 06-13-2024, 08:58 AM
          0 responses
          14 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 06-12-2024, 02:20 PM
          0 responses
          17 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 06-07-2024, 06:58 AM
          0 responses
          186 views
          0 likes
          Last Post seqadmin  
          Working...
          X