-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add transcript.length #213
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -603,6 +603,19 @@ def utr3s(self): # pragma: no cover | |
| mock_unreachable() | ||
| return [Utr()] | ||
|
|
||
| @property | ||
| def length(self) -> int: | ||
| """The total length of this transcript, summing all exon lengths (includes UTRs).""" | ||
| return sum(len(exon) for exon in self.exons) | ||
|
|
||
| @property | ||
| def length_cds(self) -> int: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like the naming will be confusing in code. eg.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a reasonable concern. I'm coming up empty trying to think of a clearer alternative.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. works for me! |
||
| """The CDS-only length of this transcript, summing all CDS element lengths. | ||
|
|
||
| Returns 0 for non-coding transcripts. | ||
| """ | ||
| return sum(len(cds) for cds in self.cdss) | ||
|
|
||
| def __getstate__(self) -> bytes: | ||
| genome = self.annotation_genome | ||
| return pickle.dumps([genome, genome.transcripts.index_of(self)]) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
introns are part of a transcript... are we conflating this with
transcriptomemrna?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gkaur can you comment on this?
The original request:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping to capture post processed transcript length based on exons and cdss components only