Code:
awk '/^>/{$0=$0"_"(++i)}1' infile
You are currently viewing the SEQanswers forums as a guest, which limits your access. Click here to register now, and join the discussion
#!/usr/bin/env python import re import string import sys infile = open(sys.argv[1]) data = infile.readlines() infile.close() outfile = open(sys.argv[2], "w") c = 1 l = 1 for i in data: i = re.sub("\n|\r", "", i) if c%2 != 0: outfile.write(i+"_" +str(l) +"\n") l+=1 else: outfile.write(i +"\n") c += 1 outfile.close()
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, Today, 06:55 AM
|
0 responses
7 views
0 likes
|
Last Post
by seqadmin
Today, 06:55 AM
|
||
Started by seqadmin, 10-02-2024, 04:51 AM
|
0 responses
104 views
0 likes
|
Last Post
by seqadmin
10-02-2024, 04:51 AM
|
||
Started by seqadmin, 10-01-2024, 07:10 AM
|
0 responses
113 views
0 likes
|
Last Post
by seqadmin
10-01-2024, 07:10 AM
|
||
Started by seqadmin, 09-30-2024, 08:33 AM
|
1 response
117 views
0 likes
|
Last Post
by EmiTom
10-07-2024, 06:46 AM
|
Leave a comment: