- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaliasFasta
More file actions
Latest commit
executable file
·26 lines (19 loc) · 480 Bytes
/
Copy pathaliasFasta
File metadata and controls
executable file
·26 lines (19 loc) · 480 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env ruby
require'rubygems'
require'bio'
if(ARGV.size != 3)
STDERR.printf("usage: %s fasta out-fasta alias-file\n", $0)
exit(1)
end
fasta,out,ali=ARGV
outFile=File.new(out,"w")
aliFile=File.new(ali,"w")
orfNum="SID000001"
Bio::FlatFile.new(Bio::FastaFormat,File.new(fasta)).eachdo |seq|
aliFile.printf("%s\t%s\n",orfNum,seq.definition)
seq.definition=orfNum
outFile.printseq
orfNum=orfNum.succ
end
outFile.close
aliFile.close