Skip to content

Commit

Permalink
Minor code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
iquasere committed Nov 23, 2023
1 parent abe4d14 commit 0b9ecdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions workflow/scripts/metaproteomics.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def select_proteins_for_second_search(self, original_db, output, results_files,
output=f'{output}/2nd_search_database.fasta')

def run(self):
"""

Path(snakemake.params.output).mkdir(parents=True, exist_ok=True)
# 1st database construction
self.database_generation(
Expand All @@ -313,7 +313,7 @@ def run(self):
self.generate_parameters_file(f'{snakemake.params.output}/1st_params.par', protein_fdr=100)
except:
print('An illegal reflective access operation has occurred. But MOSCA can handle it.')
"""

# 2nd database construction
proteins_for_second_search = []
for i in range(len(snakemake.params.names)):
Expand Down
8 changes: 4 additions & 4 deletions workflow/scripts/quantification.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def run():
else:
continue
if ',' in pexps.loc[i]['Files']:
reads = [f"{snakemake.params.output}/Preprocess/Trimmomatic/quality_trimmed_{pexps.loc[i]['Name']}_{fr}_paired.fq"
for fr in ['forward', 'reverse']]
reads = [(f"{snakemake.params.output}/Preprocess/Trimmomatic/quality_trimmed_{pexps.loc[i]['Name']}_"
f"{fr}_paired.fq") for fr in ['forward', 'reverse']]
else:
reads = [f"{snakemake.params.output}/Preprocess/Trimmomatic/quality_trimmed_{pexps.loc[i]['Name']}.fq"]
perform_alignment(
Expand All @@ -38,8 +38,8 @@ def run():
f"{snakemake.params.output}/Quantification/{pexps.loc[i]['Name']}.readcounts", reference)
# Read the results of alignment and add them to the readcounts result at sample level
normalized_by_gene_size = pd.read_csv(
f"{snakemake.params.output}/Quantification/{pexps.loc[i]['Name']}.readcounts.norm", sep='\t',
names=['Gene' if pexps.loc[i]['Data type'] == 'mrna' else 'Contig', pexps.loc[i]['Name']])
f"{snakemake.params.output}/Quantification/{pexps.loc[i]['Name']}.readcounts.norm",
sep='\t', names=['Gene' if pexps.loc[i]['Data type'] == 'mrna' else 'Contig', pexps.loc[i]['Name']])
if pexps.loc[i]['Data type'] == 'dna':
mg_result = pd.merge(mg_result, normalized_by_gene_size, how='outer', on='Contig')
else:
Expand Down

0 comments on commit 0b9ecdc

Please sign in to comment.