https://github.com/fjruizruano/ngs-protocols
Tip revision: 39a091d1fa569a7fc717ac73c4b3de07f0a1204d authored by fjruizruano on 03 August 2023, 11:48:27 UTC
adding gfa2fas.py and extract_gfa.py
adding gfa2fas.py and extract_gfa.py
Tip revision: 39a091d
get_coordinates.py
#!/usr/bin/python
from Bio import SeqIO
import sys
print "get_coordinates file.fasta"
# open FASTA and list of sequences
try:
secu = sys.argv[1]
except:
secu = raw_input("Sequence FASTA file: ")
s = SeqIO.parse(open(secu), "fasta")
name = secu.split(".")
name = name[:-1]
name = ".".join(name)
name = name+".coordinates.txt"
output = open(name, "w")
for a in s:
n = a.id
l = len(a.seq)
output.write("%s\t%s\t\t\t\n" % (n,str(l)))
output.close()