Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi #99

Merged
merged 7 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update assembly_qc_ncbi_.py
Updated assembly_qc_ncbi_.py to pull from ngs_id_list.tsv
Changes to be committed:
	modified:   lib/assembly_qc_ncbi_.py
	modified:   lib/dict_release_notes.py
  • Loading branch information
HadleyKing committed Oct 11, 2022
commit b1a193cb17f05968ead564b98619b1d8364ba02d
28 changes: 27 additions & 1 deletion lib/assembly_qc_ncbi_.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,31 @@ def usr_args():

return parser.parse_args()

def read_datasheet(input_path):
"""Read input data sheet

Designed to take the ARGOS ngs ID List and Selection Criteria and extract
all unique NCBI assembly accessions

Parameters
----------
input_path: str
file path/name to be parsed
"""

genome_assembly_ids =[]

with open(input_path, 'r', encoding='utf') as accessions:
data = csv.reader(accessions, delimiter='\t')
next(data)
for row in data:
if row[2] not in genome_assembly_ids and row[2] != '':
genome_assembly_ids.append(row[2])

genomes = ','.join(genome_assembly_ids)
efetch = f'efetch -db assembly -id {genomes} -format docsum > home/genomes.xml'
os.system(efetch)

def parse_xml(xml_file, samples):
"""Parse XML file

Expand Down Expand Up @@ -239,7 +264,8 @@ def main():
'assembly_type', 'assembly_level', 'assembly_score']

args = usr_args()
parse_xml(args.file, samples)
read_datasheet(args.file)
parse_xml('home/genomes.xml', samples)
sample_output(samples, header, args.output)

if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions lib/dict_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def usr_args():

def load_tsv(options):
"""Load TSVs

Parameters
----------
options.old: str
An inpit directory string.
options.new: str
An inpit directory string.

Returns
-------
Printout of comparison stats.
Expand Down