-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switching to a previous version of gafpack
- Loading branch information
1 parent
3d23482
commit 50c5a0c
Showing
12 changed files
with
168 additions
and
50 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
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
channels: | ||
- anaconda | ||
- conda-forge | ||
- bioconda | ||
dependencies: | ||
- python=3.11.0 | ||
- numpy=1.23.5 | ||
- pandas=1.5.2 | ||
- matplotlib=3.6.3 | ||
- scikit-learn=1.2.2 | ||
- scipy=1.10.1 | ||
- pyfaidx=0.7.2.1 |
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
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
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,49 @@ | ||
#!/usr/bin/python3 env | ||
|
||
#standard libraries | ||
import os | ||
import sys | ||
import pyfaidx | ||
|
||
def main(input_fa,input_hit,output_fa): | ||
|
||
fasta=pyfaidx.Fasta(input_fa) | ||
|
||
with open(input_hit) as fin, open(output_fa, 'w') as fout: | ||
|
||
for row in fin: | ||
|
||
row = row.strip().split("\t") | ||
|
||
if row[0][0] == "#": | ||
|
||
continue | ||
|
||
(q_idx, q_name, query_bgn, query_end, q_len, aln_anchor_count, | ||
src, ctg, ctg_bgn, ctg_end, orientation, out_seq_name) = row | ||
query_bgn = int(query_bgn) | ||
query_end = int(query_end) | ||
ctg_bgn = int(ctg_bgn) | ||
ctg_end = int(ctg_end) | ||
q_len = int(q_len) | ||
|
||
#maybe need to check why this is 12000 - but itworks for test regions | ||
if query_bgn > 12000 or q_len - query_end > 12000: | ||
|
||
continue | ||
|
||
if abs(ctg_end-ctg_bgn) > q_len * 3: | ||
|
||
continue | ||
|
||
key=[x for x in fasta.keys() if ctg+ '_' + str(ctg_bgn) in x] | ||
seq=fasta[key[0]][:].seq | ||
fout.write('>' + key[0].split('::')[1] + '\n' + seq + '\n') | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
input_fa=os.path.abspath(sys.argv[1]) | ||
input_hit=os.path.abspath(sys.argv[2]) | ||
output_fa=os.path.abspath(sys.argv[3]) | ||
main(input_fa,input_hit,output_fa) |
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
Oops, something went wrong.