Skip to content

Modify quant - #266

Merged
cying111 merged 22 commits into
BambuManuscriptRevisionfrom
modifyQuant
Jul 22, 2022
Merged

cying111 merged 22 commits into
BambuManuscriptRevisionfrom
modifyQuant

Conversation

@cying111

@cying111 cying111 commented Apr 28, 2022 •

Copy link
Copy Markdown
Collaborator

This PR includes changes:

  • incompatible reads are now assigned to unidentified portion of the genes, which is treated just as another isoform that would not have any full-length support in the gene when quantified
  • the incompatible counts are stored as metadata in the final seoutput, and will be column combined when combining across samples
  • the incompatible counts will then be used for gene expression calculation in transcriptToGeneExpression function
  • partial estimates are removed from output as it can be directly obtained based on total count estimates and full-length count estimates

@cying111 cying111 linked an issue May 9, 2022 that may be closed by this pull request
Comment thread R/bambu-quantify_utilityFunctions.R Resolved
Comment thread R/bambu-quantify_utilityFunctions.R Resolved
Comment thread R/bambu-quantify_utilityFunctions.R Resolved
@cying111
cying111 changed the base branch from bambu-dev to BambuManuscriptRevision July 22, 2022 05:57
@cying111
cying111 merged commit 136e57b into BambuManuscriptRevision Jul 22, 2022

@jonathangoeke jonathangoeke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

quantificaiton always returns 0 for this branch for all samples, not sure why (but is an outdated branch in any case). Main comments:

  • change equiRCs and txIds and readClassIds to integer and integerlist
  • IncompatibleCounts could be incompatibleCounts
    @cying111

return(se)})
}
# combine incompatible counts
IncompatibleCounts = Reduce(merge_wrapper, lapply(countsSe, FUN = function(se){metadata(se)$IncompatibleCounts}))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

to be consistent, we should name this incompatibleCounts (camelCase)

Comment thread R/bambu-quantify.R
min.primarySecondaryDist = min.primarySecondaryDist,
min.primarySecondaryDistStartEnd = min.primarySecondaryDistStartEnd,
verbose = verbose)
readClassMod <- modifyIncompatibleAssignment(readClassDist)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this function only works with the distTable, maybe better like this?
readClassDist$distTable <- modifyIncompatibleAssignment(readClassDist$distTable )
then we don't have 2 copies of the readClass object?

Comment thread R/bambu-quantify.R
min.primarySecondaryDistStartEnd = min.primarySecondaryDistStartEnd,
verbose = verbose)
readClassMod <- modifyIncompatibleAssignment(readClassDist)
annotationsUpdated <- updateAnnotations(readClassMod, annotations, verbose)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this function assigns read classes evenly to genes. Ideally this is done based on the overall gene count (after quantification?) can probably be ignored though as this is a very special case of unassigned reads overlapping multiple genes?

Comment on lines +304 to +306
distTable[order(readClassId,GENEID,tx_id),
read_class_id := paste(unique(tx_id), collapse = "."),
by = list(readClassId, GENEID)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is ideally done using txid (integer) and equiRCByTxId (integerlist) which is much faster and memory efficient

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(which would the definition of equiRCs throughout quantification)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for the unidentified this could be tracked with an additional column of logicals

@cying111
cying111 deleted the modifyQuant branch November 4, 2022 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants