forked from Serulab/Py4Bio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Serulab/Py4Bio
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from Bio import SeqIO | ||
|
||
INPUT_FILE = 'fasta22_out.fas' | ||
OUTPUT_FILE = 'fasta33.fas' | ||
|
||
with open(INPUT_FILE) as in_fh: | ||
with open(OUTPUT_FILE, 'w') as out_fh: | ||
for record in SeqIO.parse(in_fh,'fasta'): | ||
# Modify description | ||
record.description += '[Rattus norvegicus]' | ||
SeqIO.write([record], out_fh, 'fasta') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
INPUT_FILE = 'fasta22_out.fas' | ||
OUTPUT_FILE = 'fasta33.fas' | ||
|
||
with open(INPUT_FILE) as in_fh: | ||
with open(OUTPUT_FILE, 'w') as out_fh: | ||
for line in in_fh: | ||
if line.startswith('>'): | ||
line = line.replace('\n', '[Rattus norvegicus]\n') | ||
out_fh.write(line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
>SSR86 [ssr] : Tomato-EXPEN 2000 map, chr 3[Rattus norvegicus] | ||
AGGCCAGCCCCCTTTTCCCTTAAGAACTCTTTGTGAGCTTCCCGCGGTGGCGGCCGCTCT | ||
AG | ||
>SSR252 [ssr][Rattus norvegicus] | ||
TGGGCAGAGGAGCTCGTANGCATACCGCGAATTGGGTACACTTACCTGGTACCCCACCCG | ||
GGTGGAAAATCGATGGGCCCGCGGCCGCTCTAGAAGTACTCTCTCTCT | ||
>SSR257 [ssr][Rattus norvegicus] | ||
TGAGAATGAGCACATCGATACGGCAATTGGTACACTTACCTGCGACCCCACCCGGGTGGA | ||
AAATCGATGGGCCCGCGGCC |