我有下面的字符串,我想过滤的基础上,让我们说,A或T的第一个位置,其次是C或T的第二个位置,等等。
structure(list(barcode.Universe.sub = c("TCCGCTGGTGCG", "GTCGCGGACTGC",
"CTTCCAAAATAG", "CCCCTTTCGTGG", "TTTCAGCGTCAG", "TACGAGCCTGGT",
"AGCAGTATCAAC", "TAACCGTATAGA", "GGCTAATTCCGC", "CTCGGTTGGGCG",
"TCCCGTGCGCCC", "TCTCCCAAACGA", "ATCATGGTCAAC", "ACCGCACTGAAC",
"AAGTTTTCCTCA", "CTAGAGACCGAT", "CATTCTCATGGA", "ATGCGCGGCGAA",
"GAGTGCCCTAGG", "ATGAGTAGTAGG", "TCTAGCGTCATT", "TCTCAACTTCTC",
"GAGAACGCTCCT", "TACAGGACACAC", "GATTCTCACGAT", "GAGACGGAGGCC",
"GCGGCTCCTCTA", "TGGATACTCTGC", "GCACCGCGTTCA", "GAATTGATAAGT",
"GGGCAGCAGATA", "GGCATATACGGC", "TCATCACTATGA", "CGCGGCTGGGAT",
"AGTCGCCACGCT", "TTGGCCGAAATT", "CGAGACCCACCG", "TGGTGCCTCACT",
"CTGATACTGGGT", "AGGTGGCGTCTA", "GGCAAGGAGTAC", "GCGACTGAAATA",
"AGCTTCGGATTA", "GTTGCCAGACTC", "AGCTGTCGCACG", "AGGGTTCGCTGT",
"GTGCGTACCGCG", "CGCTTACACATG", "ACAACGCCATGT", "ATATACTAAGCC",
"ACCGGAATAGCT", "CTACGAACGACT", "TAACCTTATGCT", "GCCTGCAGATGA",
"CGAGTGCGGTGG", "TGGAGGTGTACT", "CTTCAATATTGA", "AACGACATAAAC",
"TACAGTGGATGC", "ATCTAAGCTGTT", "GCCTGGCATCTT", "CATGGGGAACCT",
"GCCCGAGCTAAG", "GGGTGCTCCGAC", "TAATTAGGACGC", "TACCTAAGCGAT",
"TAGTCTGTAGGC", "CGTTAACTCCGC", "GCACGAAGTCAC", "GAGCGTCCAGCT",
"CCGACTTACAAA", "CCGGTTCAGATG", "TGCAGCTGTGTG", "AATCTATTTCTT",
"TCGTATAAGGTA", "AACTGGATGCCC", "ACGAAGAACGCT", "AGTGCTCTTCTG",
"CTACAGTGTACA", "AGGGCCATACTC", "AACAACCGCTTA", "CTAGACGGCAAT",
"GGGTTGAAGAAG", "GGAGCATACTAA", "CGAACCCCGGTA", "TGTACCATGGAA",
"TTCGAGGTTGAT", "GTGCTTAGGATC", "CAACCGTATGAC", "GACGTCCTTCAG",
"TGGTAATGGACA", "ACGAGCGCTATG", "GCGGAGCCACCC", "TCAGAGGCTGGA",
"GGCCTTACGCAA", "TACGACCCATAG", "CCATTCAGCATG", "CCTAAGGGCCTT",
"GGTCTATCGCAT", "CAGTACATGTCG")), class = c("tbl_df", "tbl",
"data.frame"), row.names = c(NA, -100L))
我已经尝试了stringr和特定的软件包的DNA序列(猿)没有很好的结果。
1条答案
按热度按时间k3bvogb11#
您可以使用
grep
。其中,
^
表示字符串的开头,[AT]
与A
或T
匹配,[CT]
与C
或T
匹配。数据类型