I have the following code:
condition_1_top_genes = list("abc", "def", "efg")
condition_2_top_genes = list("a35", "2353", "rea3")
condition_3_top_genes = list("fae", "wai", "wtes")
top_genes = list(condition_1_top_genes,
condition_2_top_genes,
condition_3_top_genes)
genotypes <- list("genotype1" = genotype1,
"genotype2" = genotype2,
"genotype3" genotype3)
for (i in length(genotypes)){
for (j in ????){
FeaturePlot(genotypes[[i]], features = ??)
}
}
genotypes is a list of Seurat objects.
In the outer loop I'm looping over the Seurat objects, for the inner loop I want to loop over each of the lists in top_genes. So when i = 1 I want j to move along condition_1_top_genes, then when i=2, I want j to move along condition_2_top_genes, etc.
Any help on this syntax would be appreciated.