https://github.com/fjruizruano/ngs-protocols
Raw File
Tip revision: 39a091d1fa569a7fc717ac73c4b3de07f0a1204d authored by fjruizruano on 03 August 2023, 11:48:27 UTC
adding gfa2fas.py and extract_gfa.py
Tip revision: 39a091d
gfa2fas.py
#!/usr/bin/python2

import sys
from subprocess import call

print "Usage: gfa2fas.py GfaFile"

try:
    gfa = sys.argv[1]
except:
    gfa = raw_input("Introduce GFA file: ")

gfa_name = gfa.split(".")
gfa_name = gfa_name[:-1]
gfa_name = ".".join(gfa_name)

awk = """awk '/^S/{print ">"$2;print $3}' %s > %s.fasta""" % (gfa, gfa_name)
call(awk, shell=True)

back to top