Header Leaderboard Ad

Collapse

command for making an interleave file

Collapse

Announcement

Collapse

SEQanswers June Challenge Has Begun!

The competition has begun! We're giving away a $50 Amazon gift card to the member who answers the most questions on our site during the month. We want to encourage our community members to share their knowledge and help each other out by answering questions related to sequencing technologies, genomics, and bioinformatics. The competition is open to all members of the site, and the winner will be announced at the beginning of July. Best of luck!

For a list of the official rules, visit (https://www.seqanswers.com/forum/sit...wledge-and-win)
See more
See less
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 ([email protected]) {
      	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

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 06-01-2023, 08:56 PM
      0 responses
      9 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 06-01-2023, 07:33 AM
      0 responses
      9 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-31-2023, 07:50 AM
      0 responses
      4 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-26-2023, 09:22 AM
      0 responses
      11 views
      0 likes
      Last Post seqadmin  
      Working...
      X