У меня есть фрейм данных mydf. Я хочу посмотреть на наличие значений c.change
в Clinvar_Type
. Если присутствует, я хочу удалить все в grepl("Clinvar, colnames(mydf))
.
Это мои данные:
mydf <- structure(c("chr1:8045045:A:G", "chr1:8045045:A:G", "chr1:8045045:A:G",
"chr1:17314702:C:T", "chr1:17314702:C:T", "chr1:17314702:C:T",
"c.501A>G", "c.441A>G", "c.414A>G", "c.2775G>A", "c.2658G>A",
"c.2790G>A", "NM_007262.5(PARK7):c.501A>G (p.Ala167=)", "NM_007262.5(PARK7):c.501A>G (p.Ala167=)",
"NM_007262.5(PARK7):c.501A>G (p.Ala167=)", "NM_022089.4(ATP13A2):c.2790G>A (p.Ser930=)",
"NM_022089.4(ATP13A2):c.2790G>A (p.Ser930=)", "NM_022089.4(ATP13A2):c.2790G>A (p.Ser930=)",
"single nucleotide variant", "single nucleotide variant", "single nucleotide variant",
"single nucleotide variant", "single nucleotide variant", "single nucleotide variant",
"HGNC:16369", "HGNC:16369", "HGNC:16369", "HGNC:30213", "HGNC:30213",
"HGNC:30213"), .Dim = 6:5, .Dimnames = list(NULL, c("VarID_build37",
"c.change", "Clinvar_ Name", "Clinvar_ Type", "Clinvar_ HGNC_ID"
)))
Результат, который я хочу:
VarID_build37 c.change Clinvar_ Name Clinvar_ Type Clinvar_ HGNC_ID
"chr1:8045045:A:G" "c.501A>G" "NM_007262.5(PARK7):c.501A>G (p.Ala167=)" "single nucleotide variant" "HGNC:16369"
"chr1:8045045:A:G" "c.441A>G"
"chr1:8045045:A:G" "c.414A>G"
"chr1:17314702:C:T" "c.2775G>A"
"chr1:17314702:C:T" "c.2658G>A"
"chr1:17314702:C:T" "c.2790G>A" "NM_022089.4(ATP13A2):c.2790G>A (p.Ser930=)" "single nucleotide variant" "HGNC:30213"