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

Mbarba/logging gff #204

Merged
merged 7 commits into from
Nov 23, 2023
Merged

Mbarba/logging gff #204

merged 7 commits into from
Nov 23, 2023

Conversation

MatBarba
Copy link
Contributor

@MatBarba MatBarba commented Nov 9, 2023

Use the ensembl-py logging method to process GFF3 files
By default, nextflow creates a log_file

@MatBarba MatBarba changed the base branch from hackathon_nov23 to main November 15, 2023 11:12
MatBarba and others added 2 commits November 23, 2023 14:15
Co-authored-by: J. Alvarez-Jarreta <jalvarez@ebi.ac.uk>
@MatBarba MatBarba merged commit 8d91580 into main Nov 23, 2023
@MatBarba MatBarba deleted the mbarba/logging_gff branch November 23, 2023 14:32
Copy link
Contributor

@JAlvarezJarreta JAlvarezJarreta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of minor edits, but looks good 👍

@@ -441,7 +444,7 @@ def _normalize_transcripts(self, gene: SeqFeature, fail_types) -> SeqFeature:
message = (
f"Unrecognized transcript type: {transcript.type}" f" for {transcript.id} ({gene.id})"
)
print(message)
logging.warning(message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logging.warning(message)
logging.warning(
f"Unrecognized transcript type: {transcript.type}" f" for {transcript.id} ({gene.id})"
)

And remove the previous message declaration?

@@ -515,7 +518,7 @@ def _normalize_transcript_subfeatures(
f"Unrecognized exon type for {feat.type}: {feat.id}"
f" (for transcript {transcript.id} of type {transcript.type})"
)
print(message)
logging.warning(message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same suggestion as before:

Suggested change
logging.warning(message)
logging.warning((
f"Unrecognized exon type for {feat.type}: {feat.id}"
f" (for transcript {transcript.id} of type {transcript.type})"
))

args = parser.parse_args()
init_logging(args.log_level, args.log_file, args.log_file_level)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
init_logging(args.log_level, args.log_file, args.log_file_level)
init_logging_with_args(args)

@@ -35,6 +36,7 @@

from ensembl.io.genomio.gff3.extract_annotation import FunctionalAnnotations
from ensembl.utils.argparse import ArgumentParser
from ensembl.utils.logging import init_logging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from ensembl.utils.logging import init_logging
from ensembl.utils.logging import init_logging_with_args

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants