File: qseq2fasta.pl

package info (click to toggle)
sspace 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,752 kB
  • ctags: 165
  • sloc: perl: 2,382; python: 374; makefile: 19; sh: 18
file content (24 lines) | stat: -rwxr-xr-x 482 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl

use strict;

if($#ARGV<0){
   die "Usage: $0 <file>\n";
}

open(IN,$ARGV[0]) || die "Can't open $ARGV[0] for reading --fatal.\n";
my $fasta = $ARGV[0] . ".fa";
open(OUT,">$fasta") || die "Can't open $fasta for writing --fatal.\n";

while (<IN>) {
	chomp;
	my @parts = split(/\s+/);
        my $concat = ">$parts[0]:$parts[2]:$parts[3]:$parts[4]:$parts[5]#$parts[6]/$parts[7]";
        print OUT "$concat\n";
	print OUT "$parts[8]\n";
}

close IN;
close OUT;

exit;