-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/sablokgaurav/graphanalyzer
- Loading branch information
Showing
3 changed files
with
30 additions
and
116 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
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,20 @@ | ||
#!/usr/bin/python | ||
# Universitat Potsdam | ||
# Author Gaurav Sablok | ||
# date: 2024-2-29 | ||
def gfafastawrite(gfafile, filewrite): | ||
""" | ||
a gfa to fasta write for writing the graph connections for the | ||
GFA files | ||
""" | ||
sort = list(pd.DataFrame([line.split("\t") for line in open("/home/gaurav/Downloads/MT.gfa")], \ | ||
columns = ["a","b","c","d","e","f","g"])["c"]) | ||
indices = [i for i in range(len(sort)) if " " not in sort[i] and "-" not in sort[i]] | ||
sequences = [i for i in sort if " " not in i and "-" not in i] | ||
ids = list(pd.DataFrame([line.split("\t") for line in open("/home/gaurav/Downloads/MT.gfa")], \ | ||
columns = ["a","b","c","d","e","f","g"])["b"])[0:len(indices)] | ||
with open(filewrite, "w") as fastawrite: | ||
for i in range(len(ids)): | ||
fastawrite.write(">" ids[i]) | ||
fastawrite.write(sequences[i]) | ||
fastawrite.close() |
This file was deleted.
Oops, something went wrong.