Set new Idents based on gene expression in Seurat and mix n match identities to compare using FindAllMarkers
For the first question, you can use ifelse() to create a new column in the meta.data slot:

All_Samples@meta.data$new_column &lt;-
  ifelse(
    rownames(All_Samples@meta.data) %in% colnames(All_Samples_GeneA_Pos),
    "GeneA_Pos",
    "GeneB_Pos"
  )


colnames(seurat_object) provides a vector of cell names in a given Seurat object. Here whatever cell that is in the All_Samples_GeneA_Pos object would be GeneA_Pos and whatever is not GeneB_Pos. To better control the behavior, you can use a "nested" ifelse(); you can have another ifelse() instead of the "GeneB_Pos" bit above.

For the second question, the rationale is the same as above, you can define an extra column with the "identities of interest", then use these identities with SetIdent() and then in turn using two identities of interest in the differential expression call.