stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
330 stars 88 forks source link

Use Signac with annotation from gtf file #1793

Open lldelisle opened 1 month ago

lldelisle commented 1 month ago

Dear Signac developpers, I realized that signac requires that the Annotation slot gets the transcript ids stored into tx_id. While it is the case for the annotations from GetGRangesFromEnsDb, it is not the case from the import from file. I don't know if the best place is in the code of signac or in the vignettes and/or in the man for CreateChromatinAssay but would be good to introduce a:

if (is.null(annotation$tx_id)) {
  annotation$tx_id <- annotation$transcript_id
}

I would be happy to write a PR if you tell me where you prefer.

timoast commented 1 month ago

If you'd like to take a shot at adding this to the gene annotation setter function I'd be happy to incorporate something like this into Signac

https://github.com/stuart-lab/signac/blob/0b33b1154f9a610897d1efad2c0065081c4e7132/R/objects.R#L862

lldelisle commented 1 month ago

See #1797