Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • command for making an interleave file

    Hello,

    I have two separate files containing R1 and R2 reads from HiSeq. The number of each file is different from QC. I have found few commands generating one interleave file from R1 and R2 files. But I also want to generate another file only with orphans rather than discarding them. Please give me direction to that script. Thank you.

  • #2
    The software Trimmomatic can generate the orphans for you in addition to QC filter and removing adapters, all in one go. If you want interleaved PE reads, then just take the Paired files output and implement what you have already done on these.

    Comment


    • #3
      I would recommend using filtering programs that keep track of the paired end relationship and separates them into another file when the mate doesn't meet your filtering requirements. I have had good luck with Trimmomatic (http://www.usadellab.org/cms/?page=trimmomatic).

      With the pared files in hand a simple script is all that is needed to interleave them. The one below used to come with velvet.

      Code:
      #!/usr/bin/perl
      
      if (!@ARGV) {
      	print "Usage: $0 forward_reads.fa reverse_reaads.fa outfile.fa\n";
      	print "\tforward_reads.fa / reverse_reads.fa : paired reads to be merged\n";
      	print "\toutfile.fa : outfile to be created\n";
      	system.exit(0);	
      }
      
      $filenameA = $ARGV[0];
      $filenameB = $ARGV[1];
      $filenameOut = $ARGV[2];
      
      die "Could not open $filenameA" unless (-e $filenameA);
      die "Could not open $filenameB" unless (-e $filenameB);
      
      open FILEA, "< $filenameA";
      open FILEB, "< $filenameB";
      
      open OUTFILE, "> $filenameOut";
      
      my ($lineA, $lineB);
      
      $lineA = <FILEA>;
      $lineB = <FILEB>;
      
      while(defined $lineA) {
      	print OUTFILE $lineA;
      	$lineA = <FILEA>;
      	while (defined $lineA && $lineA !~ m/>/) { 
      		print OUTFILE $lineA;
      		$lineA = <FILEA>;
      	}
      
      	print OUTFILE $lineB;
      	$lineB = <FILEB>;
      	while (defined $lineB && $lineB !~ m/>/) { 
      		print OUTFILE $lineB;
      		$lineB = <FILEB>;
      	}
      }

      Comment

      Latest Articles

      Collapse

      • seqadmin
        Non-Coding RNA Research and Technologies
        by seqadmin




        Non-coding RNAs (ncRNAs) do not code for proteins but play important roles in numerous cellular processes including gene silencing, developmental pathways, and more. There are numerous types including microRNA (miRNA), long ncRNA (lncRNA), circular RNA (circRNA), and more. In this article, we discuss innovative ncRNA research and explore recent technological advancements that improve the study of ncRNAs.

        Nobel Prize for MicroRNA Discovery
        This week,...
        10-07-2024, 08:07 AM
      • seqadmin
        Recent Developments in Metagenomics
        by seqadmin





        Metagenomics has improved the way researchers study microorganisms across diverse environments. Historically, studying microorganisms relied on culturing them in the lab, a method that limits the investigation of many species since most are unculturable1. Metagenomics overcomes these issues by allowing the study of microorganisms regardless of their ability to be cultured or the environments they inhabit. Over time, the field has evolved, especially with the advent...
        09-23-2024, 06:35 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 10-11-2024, 06:55 AM
      0 responses
      11 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 10-02-2024, 04:51 AM
      0 responses
      110 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 10-01-2024, 07:10 AM
      0 responses
      114 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 09-30-2024, 08:33 AM
      1 response
      121 views
      0 likes
      Last Post EmiTom
      by EmiTom
       
      Working...
      X