Entering edit mode
2.0 years ago
V
▴
410
Hello community,
I have multiple samples (keeping it two for this example), lets call them S1 and S2 (seurat objects), which I want to run a traditional Seurat analysis on them. While it's manageable to run everything in the Seurat pipeline twice (e.g add percent mitochondria, filtering etc), I was wondering if there's a more automated/efficient way.
I tried writing a loop, but that didnt work at all....This is what I did :
samples = c('S1', 'S2')
for (sample in samples){
{sample}[["percent.mt"]] <- PercentageFeatureSet({sample}, pattern = "^MT-")
}
Any advice you would have would be much appreciated.
Why not write a function
Fantastic, this definitely works, thank you!
Is there a way of putting this in a loop? Following on from your example above, I'm trying to do something like :
but it doesnt seem to like that.
or