Skip to content

Commit

Permalink
fix chainf iles
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahgonicholson committed Oct 16, 2024
1 parent 608dea2 commit eea955e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/encoded/commands/create_annotated_filenames.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,15 @@ def get_sequencing_and_assay_codes(
sequencers: List[Dict[str], Any],
assays: List[Dict[str], Any],
) -> FilenamePart:
"""Get sequencing and assay codes for file."""
"""Get sequencing and assay codes for file.
Returns XX for Reference Genome and Reference Conversion files.
"""
sequencing_codes = get_sequencing_codes(sequencers)
assay_codes = get_assay_codes(assays)
if len(sequencing_codes) == 1 and len(assay_codes) == 1:
return get_filename_part(value=f"{sequencing_codes[0]}{assay_codes[0]}")
elif file_constants.DATA_CATEGORY_REFERENCE_GENOME in file.get("data_category",""):
elif file_constants.DATA_CATEGORY_REFERENCE_GENOME in file.get("data_category","") or file_constants.DATA_CATEGORY_REFERENCE_CONVERSION in file.get("data_category",""):
return get_filename_part(value="XX")
errors = []
if not sequencing_codes:
Expand Down Expand Up @@ -820,6 +823,7 @@ def get_analysis(
value = get_analysis_value(
software_and_versions, reference_genome_code
)
import pdb; pdb.set_trace()
if file_format_utils.is_chain_file(file_extension):
value = f"{value}{ANALYSIS_INFO_SEPARATOR}{get_chain_file_value(file)}"
if not value:
Expand Down
2 changes: 1 addition & 1 deletion src/encoded/commands/release_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def get_file_sets_from_file(self) -> List[dict]:
)
mwfrs = ff_utils.search_metadata(search_filter, key=self.key)
if len(mwfrs) != 1:
if file_constants.DATA_CATEGORY_REFERENCE_GENOME not in self.file["data_category"]:
if file_constants.DATA_CATEGORY_REFERENCE_GENOME not in self.file["data_category"] and file_constants.DATA_CATEGORY_REFERENCE_CONVERSION not in self.file["data_category"]:
self.print_error_and_exit(
(
f"Expected exactly one associated MetaWorkflowRun, got"
Expand Down
3 changes: 2 additions & 1 deletion src/encoded/item_utils/file_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ def get_other_allowed_extensions(properties: Dict[str, Any]) -> str:


def is_chain_file(properties: Dict[str, Any]) -> bool:
return get_standard_file_extension(properties) == "chain.gz"
return get_standard_file_extension(properties) in ["chain.gz","chain"]

0 comments on commit eea955e

Please sign in to comment.