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

bins will now always reference all biological samples #10

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
56 changes: 0 additions & 56 deletions examples/localtest.yaml

This file was deleted.

18 changes: 8 additions & 10 deletions submg/binSubmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def get_bin_quality(config, silent=False) -> dict:

def __prep_bins_samplesheet(filtered_bins: list,
config: dict,
assembly_sample_accession: str,
sample_accession_data: list,
samples_submission_dir: str,
upload_taxonomy_data: dict) -> str:
"""
Expand All @@ -119,9 +119,8 @@ def __prep_bins_samplesheet(filtered_bins: list,
Args:
filtered_bins (list): A list of bin names to submit.
config (dict): The config dictionary.
assembly_sample_accession (str): Either the accession of a co-assembly
virtual sample or the accession of the single biological sample
which the assembly is based on.
sample_accession_data (list): A list of dictionaries with the data
about each biological sample
samples_submission_dir (str): The directory where the samplesheet will
be written to.
upload_taxonomy_data (dict): A dictionary with the taxid and scientific
Expand All @@ -143,7 +142,7 @@ def __prep_bins_samplesheet(filtered_bins: list,
collection_date = utility.from_config(config, 'ASSEMBLY', 'collection date')
geographic_location_country = utility.from_config(config, 'ASSEMBLY', 'geographic location (country and/or sea)')
investigation_type = staticConfig.bin_investigation_type
sample_derived_from = assembly_sample_accession
sample_derived_from = ",".join([x['accession'] for x in sample_accession_data])
metagenomic_source = utility.from_config(config, 'METAGENOME_SCIENTIFIC_NAME')
sequencing_method = utility.from_config(config, 'SEQUENCING_PLATFORMS')
if isinstance(sequencing_method, list):
Expand Down Expand Up @@ -518,7 +517,7 @@ def get_bins_in_dir(bins_directory: str) -> list:
def submit_bins(filtered_bins: list,
config: dict,
upload_taxonomy_data: dict,
assembly_sample_accession: str,
sample_accession_data: list,
run_accessions,
staging_dir: str,
logging_dir: str,
Expand All @@ -536,9 +535,8 @@ def submit_bins(filtered_bins: list,
config (dict): The config dictionary.
upload_taxonomy_data (dict): A dictionary with the taxid and scientific
name for each bin.
assembly_sample_accession (str): Either the accession of a co-assembly
virtual sample or the accession of the single biological sample
which the assembly is based on.
sample_accession_data (list): A list of dictionaries with the data
about each biological sample
run_accessions (list): A list of accession numbers of the runs.
staging_dir (str): The directory where the bins will be staged.
logging_dir (str): The directory where the logs will be written to.
Expand Down Expand Up @@ -591,7 +589,7 @@ def submit_bins(filtered_bins: list,
os.makedirs(samples_submission_dir, exist_ok=False)
samplesheet = __prep_bins_samplesheet(filtered_bins,
config,
assembly_sample_accession,
sample_accession_data,
samples_submission_dir,
upload_taxonomy_data)

Expand Down
11 changes: 6 additions & 5 deletions submg/magSubmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def __prep_mags_samplesheet(config: dict,

Args:
config (dict): The config dictionary.
sample_accession_data (list): A list of dictionaries with the sample
accession data.
sample_accession_data (list): A list of dictionaries with the data
about each biological sample
mag_metadata (dict): A dictionary with the metadata for each MAG.
bin_taxonomy_data (dict): A dictionary with the taxonomy data for each
bin.
Expand Down Expand Up @@ -351,7 +351,6 @@ def submit_mags(config: dict,
sample_accession_data: list,
run_accessions,
bin_taxonomy_data: dict,
# bin_to_sample: dict,
staging_dir: str,
logging_dir: str,
depth_files: str,
Expand All @@ -365,10 +364,12 @@ def submit_mags(config: dict,

Args:
config (dict): The config dictionary.
upload_taxonomy_data (dict): A dictionary with the taxid and scientific
name for each bin.
metagenome_scientific_name (str): The scientific name of the metagenome.
sample_accession_data (list): A list of dictionaries with the data
about each biological sample
run_accessions (list): A list of accession numbers of the runs.
bin_taxonomy_data (dict): A dictionary with the taxid and scientific
name for each bin.
staging_dir (str): The directory where the bins will be staged.
logging_dir (str): The directory where the logs will be written to.
depth_files (list): A list of paths to the depth files. Either this or
Expand Down
4 changes: 1 addition & 3 deletions submg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,6 @@ def submit(args):
args.staging_dir,
args.logging_dir,
test=args.development_service)


else:
sample_accessions = utility.from_config(config,
'SAMPLE_ACCESSIONS')
Expand Down Expand Up @@ -383,7 +381,7 @@ def submit(args):
submit_bins(filtered_bins,
config,
bin_taxonomy,
assembly_sample_accession,
sample_accession_data,
run_accessions,
prepdir(args.staging_dir, 'bins'),
prepdir(args.logging_dir, 'bins'),
Expand Down
Loading