Hi guys,
I have R programming question: I have more than 1000 samples (1:1000) with both GTs and ADs for each sample (Genotype). I want to match the genotype for all the samples (Genotype) in (Names), or in other words, I want to match Gene1.GT and get both Gene1.GT and Gene1.AD and so forth from Genotype and get the (Result) as listed below. Thank you.
Names <- c("cebi", "pithe", "Gene1.GT", "sapiens" "Gene2.GT", "calli", "Gene3.GT")
Genotype <- c("Gene1.GT", "Gene1.AD", "Gene2.GT", "Gene2.AD", "Gene3.GT", "Gene3.AD")
Result:
-> "cebi", "pithe", "Gene1.GT", "Gene1.AD", "sapiens", "Gene2.GT", "Gene2.AD", "calli", "Gene3.GT", "Gene3.AD"
It's a little unclear how you are mapping between names and genotypes. Can you explain a bit more about how the result relates to the input?
Thank you for your reply. I want to match the part Gene1, Gene2, Gene3... and get both GTs and ADs for them. For example, I want to match "Gene1" common in both objects and get Gene1.GT and Gene1.AD from (Genotype) and get the (Result). So, I want to match Gene1:Gene1000 and get all the corresponding GTs and ADs in the same order it matches with the (Names).