📄 parsertest.java
字号:
} public void testPattern184() throws Exception { // Generic amino acid: low specificity. parse("[NX3,NX4+][CX4H]([*])[CX3](=[OX1])[O,N]"); } public void testPattern185() throws Exception { //Template for 20 standard a.a.s parse("[$([$([NX3H,NX4H2+]),$([NX3](C)(C)(C))]1[CX4H]([CH2][CH2][CH2]1)[CX3](=[OX1])[OX2H,OX1-,N])," + "$([$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX" + "4H2][CX3](=[OX1])[OX2H,OX1-,N]),$([$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX4H]([*])[CX3](=[OX1])[OX2H,OX1-,N])]"); } public void testPattern186() throws Exception { // Proline parse("[$([NX3H,NX4H2+]),$([NX3](C)(C)(C))]1[CX4H]([CH2][CH2][CH2]1)[CX3](=[OX1])[OX2H,OX1-,N]"); } public void testPattern187() throws Exception { // Glycine parse("[$([$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX4H2][CX3](=[OX1])[OX2H,OX1-,N])]"); } public void testPattern188() throws Exception { // Alanine parse("[$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX4H]([CH3X4])[CX3](=[OX1])[OX2H,OX1-,N]"); } public void testPattern189() throws Exception { //18_standard_aa_side_chains. parse("([$([CH3X4]),$([CH2X4][CH2X4][CH2X4][NHX3][CH0X3](=[NH2X3+,NHX2+0])[NH2X3])," + "$([CH2X4][CX3](=[OX1])[NX3H2]),$([CH2X4][CX3](=[OX1])[OH0-,OH])," + "$([CH2X4][SX2H,SX1H0-]),$([CH2X4][CH2X4][CX3](=[OX1])[OH0-,OH])," + "$([CH2X4][#6X3]1:[$([#7X3H+,#7X2H0+0]:[#6X3H]:[#7X3H]),$([#7X3H])]:" + "[#6X3H]:[$([#7X3H+,#7X2H0+0]:[#6X3H]:[#7X3H]),$([#7X3H])]:[#6X3H]1)," + "$([CHX4]([CH3X4])[CH2X4][CH3X4]),$([CH2X4][CHX4]([CH3X4])[CH3X4])," + "$([CH2X4][CH2X4][CH2X4][CH2X4][NX4+,NX3+0]),$([CH2X4][CH2X4][SX2][CH3X4])," + "$([CH2X4][cX3]1[cX3H][cX3H][cX3H][cX3H][cX3H]1),$([CH2X4][OX2H])," + "$([CHX4]([CH3X4])[OX2H]),$([CH2X4][cX3]1[cX3H][nX3H][cX3]2[cX3H][cX3H][cX3H][cX3H][cX3]12)," + "$([CH2X4][cX3]1[cX3H][cX3H][cX3]([OHX2,OH0X1-])[cX3H][cX3H]1),$([CHX4]([CH3X4])[CH3X4])])"); } public void testPattern190() throws Exception { // N in Any_standard_amino_acid. parse("[$([$([NX3H,NX4H2+]),$([NX3](C)(C)(C))]1[CX4H]([CH2][CH2][CH2]1)[CX3]" + "(=[OX1])[OX2H,OX1-,N]),$([$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX4H2][CX3]" + "(=[OX1])[OX2H,OX1-,N]),$([$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX4H]([$([CH3X4])," + "$([CH2X4][CH2X4][CH2X4][NHX3][CH0X3](=[NH2X3+,NHX2+0])[NH2X3]),$" + "([CH2X4][CX3](=[OX1])[NX3H2]),$([CH2X4][CX3](=[OX1])[OH0-,OH])," + "$([CH2X4][SX2H,SX1H0-]),$([CH2X4][CH2X4][CX3](=[OX1])[OH0-,OH])," + "$([CH2X4][#6X3]1:[$([#7X3H+,#7X2H0+0]:[#6X3H]:[#7X3H]),$([#7X3H])]:" + "[#6X3H]:[$([#7X3H+,#7X2H0+0]:[#6X3H]:[#7X3H]),$([#7X3H])]:[#6X3H]1)," + "$([CHX4]([CH3X4])[CH2X4][CH3X4]),$([CH2X4][CHX4]([CH3X4])[CH3X4])," + "$([CH2X4][CH2X4][CH2X4][CH2X4][NX4+,NX3+0]),$([CH2X4][CH2X4][SX2][CH3X4])," + "$([CH2X4][cX3]1[cX3H][cX3H][cX3H][cX3H][cX3H]1),$([CH2X4][OX2H])," + "$([CHX4]([CH3X4])[OX2H]),$([CH2X4][cX3]1[cX3H][nX3H][cX3]2[cX3H][cX3H][cX3H][cX3H][cX3]12)," + "$([CH2X4][cX3]1[cX3H][cX3H][cX3]([OHX2,OH0X1-])[cX3H][cX3H]1)," + "$([CHX4]([CH3X4])[CH3X4])])[CX3](=[OX1])[OX2H,OX1-,N])]"); } public void testPattern191() throws Exception { // Non-standard amino acid. parse("[$([NX3,NX4+][CX4H]([*])[CX3](=[OX1])[O,N]);!$([$([$([NX3H,NX4H2+])," + "$([NX3](C)(C)(C))]1[CX4H]([CH2][CH2][CH2]1)[CX3](=[OX1])[OX2H,OX1-,N])," + "$([$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX4H2][CX3](=[OX1])[OX2H,OX1-,N])," + "$([$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX4H]([$([CH3X4]),$([CH2X4][CH2X4][CH2X4][NHX3][CH0X3]" + "(=[NH2X3+,NHX2+0])[NH2X3]),$([CH2X4][CX3](=[OX1])[NX3H2]),$([CH2X4][CX3](=[OX1])[OH0-,OH])," + "$([CH2X4][SX2H,SX1H0-]),$([CH2X4][CH2X4][CX3](=[OX1])[OH0-,OH]),$([CH2X4][#6X3]1:" + "[$([#7X3H+,#7X2H0+0]:[#6X3H]:[#7X3H]),$([#7X3H])]:" + "[#6X3H]:[$([#7X3H+,#7X2H0+0]:[#6X3H]:[#7X3H])," + "$([#7X3H])]:[#6X3H]1),$([CHX4]([CH3X4])[CH2X4][CH3X4]),$([CH2X4][CHX4]([CH3X4])[CH3X4])," + "$([CH2X4][CH2X4][CH2X4][CH2X4][NX4+,NX3+0]),$([CH2X4][CH2X4][SX2][CH3X4])," + "$([CH2X4][cX3]1[cX3H][cX3H][cX3H][cX3H][cX3H]1),$([CH2X4][OX2H]),$([CHX4]([CH3X4])[OX2H])," + "$([CH2X4][cX3]1[cX3H][nX3H][cX3]2[cX3H][cX3H][cX3H][cX3H][cX3]12)," + "$([CH2X4][cX3]1[cX3H][cX3H][cX3]([OHX2,OH0X1-])[cX3H][cX3H]1)," + "$([CHX4]([CH3X4])[CH3X4])])[CX3](=[OX1])[OX2H,OX1-,N])])]"); } public void testPattern192() throws Exception { //Azide group parse("[$(*-[NX2-]-[NX2+]#[NX1]),$(*-[NX2]=[NX2+]=[NX1-])]"); } public void testPattern193() throws Exception { // Azide ion parse("[$([NX1-]=[NX2+]=[NX1-]),$([NX1]#[NX2+]-[NX1-2])]"); } public void testPattern194() throws Exception { //Azide or azide ion parse("[$([$(*-[NX2-]-[NX2+]#[NX1]),$(*-[NX2]=[NX2+]=[NX1-])]),$([$([NX1-]=[NX2+]=[NX1-]),$([NX1]#[NX2+]-[NX1-2])])]"); } public void testPattern195() throws Exception { // Sulfide parse("[#16X2H0]"); } public void testPattern196() throws Exception { // Mono-sulfide parse("[#16X2H0][!#16]"); } public void testPattern197() throws Exception { // Di-sulfide parse("[#16X2H0][#16X2H0]"); } public void testPattern198() throws Exception { // Two sulfides parse("[#16X2H0][!#16].[#16X2H0][!#16]"); } public void testPattern199() throws Exception { // Acid/conj-base parse("[OX2H,OX1H0-]"); } public void testPattern200() throws Exception { // Non-acid Oxygen parse("[OX2H0]"); } public void testPattern201() throws Exception { // Acid/base parse("[H1,H0-]"); } public void testPattern202() throws Exception { parse("([Cl!$(Cl~c)].[c!$(c~Cl)])"); } public void testPattern203() throws Exception { parse("([Cl]).([c])"); } public void testPattern204() throws Exception { parse("([Cl].[c])"); } public void testPattern205() throws Exception { parse("[NX3;H2,H1;!$(NC=O)].[NX3;H2,H1;!$(NC=O)]"); } public void testPattern206() throws Exception { parse("[#0]"); } public void testPattern207() throws Exception { parse("[*!H0,#1]"); } public void testPattern208() throws Exception { parse("[#6!H0,#1]"); } public void testPattern209() throws Exception { parse("[H,#1]"); } public void testPattern210() throws Exception { parse("[!H0;F,Cl,Br,I,N+,$([OH]-*=[!#6]),+]"); } public void testPattern211() throws Exception { parse("[CX3](=O)[OX2H1]"); } public void testPattern212() throws Exception { parse("[CX3](=O)[OX1H0-,OX2H1]"); } public void testPattern213() throws Exception { parse("[$([OH]-*=[!#6])]"); } public void testPattern214() throws Exception { // Phosphoric_Acid parse("[$(P(=[OX1])([$([OX2H]),$([OX1-]),$([OX2]P)])([$([OX2H]),$([OX1-]),$([OX2]P)])[$([OX2H]),$([OX1-]),$([OX2]P)]),$([P+]([OX1-])([$([OX" + "2H]),$([OX1-]),$([OX2]P)])([$([OX2H]),$([OX1-]),$([OX2]P)])[$([OX2H]),$([OX1-]),$([OX2]P)])]"); } public void testPattern215() throws Exception { // Sulfonic Acid. High specificity. parse("[$([#16X4](=[OX1])(=[OX1])([#6])[OX2H,OX1H0-]),$([#16X4+2]([OX1-])([OX1-])([#6])[OX2H,OX1H0-])]"); } public void testPattern216() throws Exception { // Acyl Halide parse("[CX3](=[OX1])[F,Cl,Br,I]"); } public void testPattern217() throws Exception { parse("[NX2-]"); } public void testPattern218() throws Exception { parse("[OX2H+]=*"); } public void testPattern219() throws Exception { parse("[OX3H2+]"); } public void testPattern220() throws Exception { parse("[#6+]"); } public void testPattern221() throws Exception { parse("[$([cX2+](:*):*)]"); } public void testPattern222() throws Exception { parse("[$([NX1-]=[NX2+]=[NX1-]),$([NX1]#[NX2+]-[NX1-2])]"); } public void testPattern223() throws Exception { parse("[+1]~*~*~[-1]"); } public void testPattern224() throws Exception { parse("[$([!-0!-1!-2!-3!-4]~*~[!+0!+1!+2!+3!+4]),$([!-0!-1!-2!-3!-4]~*~*~[!+0!+1!+2!+3!+4]),$([!-0!-1!-2!-3!-4]~*~*~*~[!+0!+1!+2!+3!+4]),$([!-0!-1!-2!-3!-4]~*~*~*~*~[!+0!+1!+2!+3!+4]),$([!-0!-1!-2!-3!-4]~*~*~*~*~*~[!+0!+1!+2!+3!+4]),$([!-0!-1!-2!-3!-4]~*~*~*~*~*~*~[!+0!+1!+2!+3!+4]),$([!-0!-1!-2!-3!-4]~*~*~*~*~*~*~*~[!+0!+1!+2!+3!+4]),$([!-0!-1!-2!-3!-4]~*~*~*~*~*~*~*~*~[!+0!+1!+2!+3!+4]),$([!-0!-1!-2!-3!-4]~*~*~*~*~*~*~*~*~*~[!+0!+1!+2!+3!+4])]"); } public void testPattern225() throws Exception { parse("([!-0!-1!-2!-3!-4].[!+0!+1!+2!+3!+4])"); } public void testPattern226() throws Exception { // Hydrogen-bond acceptor, Only hits carbonyl and nitroso parse("[#6,#7;R0]=[#8]"); } public void testPattern227() throws Exception { // Hydrogen-bond acceptor parse("[!$([#6,F,Cl,Br,I,o,s,nX3,#7v5,#15v5,#16v4,#16v6,*+1,*+2,*+3])]"); } public void testPattern228() throws Exception { parse("[!$([#6,H0,-,-2,-3])]"); } public void testPattern229() throws Exception { parse("[!H0;#7,#8,#9]"); } public void testPattern230() throws Exception { parse("[O,N;!H0]-*~*-*=[$([C,N;R0]=O)]"); } public void testPattern231() throws Exception { parse("[#6;X3v3+0]"); } public void testPattern232() throws Exception { parse("[#7;X2v4+0]"); } public void testPattern233() throws Exception { // Amino Acid parse("[$([$([NX3H,NX4H2+]),$([NX3](C)(C)(C))]1[CX4H]([CH2][CH2][CH2]1)[CX3](=[OX1])[OX2H,OX1-,N]),$([$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX4H2][" + "CX3](=[OX1])[OX2H,OX1-,N]),$([$([NX3H2,NX4H3+]),$([NX3H](C)(C))][CX4H]([*])[CX3](=[OX1])[OX2H,OX1-,N])]"); } public void testPattern234() throws Exception { parse("[#6][CX3](=O)[$([OX2H0]([#6])[#6]),$([#7])]"); } public void testPattern235() throws Exception { parse("[#8]=[C,N]-aaa[F,Cl,Br,I]"); } public void testPattern236() throws Exception { parse("[O,N;!H0;R0]"); } public void testPattern237() throws Exception { parse("[#8]=[C,N]"); } public void testPattern238() throws Exception { // PCB parse("[$(c:cCl),$(c:c:cCl),$(c:c:c:cCl)]-[$(c:cCl),$(c:c:cCl),$(c:c:c:cCl)]"); } public void testPattern239() throws Exception { // Imidazolium Nitrogen parse("[nX3r5+]:c:n"); } public void testPattern240() throws Exception { // 1-methyl-2-hydroxy benzene with either a Cl or H at the 5 position. parse("[c;$([*Cl]),$([*H1])]1ccc(O)c(C)c1"); parse("Cc1:c(O):c:c:[$(cCl),$([cH])]:c1"); } public void testPattern241() throws Exception { // Nonstandard atom groups. parse("[!#1;!#2;!#3;!#5;!#6;!#7;!#8;!#9;!#11;!#12;!#15;!#16;!#17;!#19;!#20;!#35;!#53]"); } /** * From http://www.daylight.com/dayhtml_tutorials/languages/smarts/index.html */ public void testPropertyCharge1() throws Exception { assertEquals(0, match("[+1]", "[OH-].[Mg+2]")); } public void testPropertyCharge2() throws Exception { assertEquals(1, match("[+1]", "COCC(O)Cn1ccnc1[N+](=O)[O-]")); } public void testPropertyCharge3() throws Exception { assertEquals(1, match("[+1]", "[NH4+]")); } public void testPropertyCharge4() throws Exception { assertEquals(0, match("[+1]", "CN1C(=O)N(C)C(=O)C(N(C)C=N2)=C12")); } public void testPropertyCharge5() throws Exception { assertEquals(2, match("[+1]", "[Cl-].[Cl-].NC(=O)c2cc[n+](COC[n+]1ccccc1C=NO)cc2")); } public void testPropertyAromatic1() throws Exception { int m = match("[a]", "c1cc(C)c(N)cc1"); assertEquals(6, m); } public void testPropertyAromatic2() throws Exception { int m = match("[a]", "c1c(C)c(N)cnc1"); assertEquals(6, m); } public void testPropertyAromatic3() throws Exception { int m = match("[a]", "c1(C)c(N)cco1"); assertEquals(5, m); } public void testPropertyAromatic4() throws Exception { int m = match("[a]", "c1c(C)c(N)c[nH]1"); assertEquals(5, m); } public void testPropertyAromatic5() throws Exception { int m = match("[a]", "O=n1ccccc1"); assertEquals(6, m); } public void testPropertyAromatic6() throws Exception { int m = match("[a]", "[O-][n+]1ccccc1"); assertEquals(6, m); } public void testPropertyAromatic7() throws Exception { int m = match("[a]", "c1ncccc1C1CCCN1C"); assertEquals(6, m); } public void testPropertyAromatic8() throws Exception { int m = match("[a]", "c1ccccc1C(=O)OC2CC(N3C)CCC3C2C(=O)OC"); assertEquals(6, m); } public void testPropertyAliphatic1() throws Exception { int m = match("[A]", "c1cc(C)c(N)cc1"); assertEquals(2, m); } public void testPropertyAliphatic2() throws Exception { int m = match("[A]", "CCO"); assertEquals(3, m); } public void testPropertyAliphatic3() throws Exception { int m = match("[A]", "C=CC=CC=C"); assertEquals(6, m); } public void testPropertyAliphatic4() throws Exception { int m = match("[A]", "CC(C)(C)C"); assertEquals(5, m); } public void testPropertyAliphatic5() throws Exception { int m = match("[A]", "CCN(CC)C(=O)C1CN(C)C2CC3=CNc(ccc4)c3c4C2=C1"); assertEquals(15, m); } public void testPropertyAliphatic6() throws Exception { int m = match("[A]", "N12CCC36C1CC(C(C2)=CCOC4CC5=O)C4C3N5c7ccccc76"); assertEquals(19, m); } //TODO: atomicnumber always 0 in smiles parsed atomcontainer public void testPropertyAtomicNumber1() throws Exception { int m = match("[#6]", "c1cc(C)c(N)cc1"); assertEquals(7, m); } public void testPropertyAtomicNumber2() throws Exception { int m = match("[#6]", "CCO"); assertEquals(2, m); } public void testPropertyAtomicNumber3() throws Exception { int m = match("[#6]", "C=CC=CC=C-O"); assertEquals(6, m); } public void testPropertyAtomicNumber4() throws Exception { int m = match("[#6]", "CC(C)(C)C"); assertEquals(5, m); } public void testPropertyAtomicNumber5() throws Exception { int m = match("[#6]", "COc1cc2c(ccnc2cc1)C(O)C4CC(CC3)C(C=C)CN34"); assertEquals(20, m); } public void testPropertyAtomicNumber6() throws Exception { int m = match("[#6]", "C123C5C(O)C=CC2C(N(C)CC1)Cc(ccc4O)c3c4O5"); assertEquals(17, m); } public void testPropertyAtomicNumber7() throws Exception { int m = match("[#6]", "C123C5C(OC(=O)C)C=CC2C(N(C)CC1)Cc(ccc4OC(=O)C)c3c4O5"); assertEquals(21, m); } public void testPropertyR1() throws Exception { int m = match("[R2]", "N12CCC36C1CC(C(C2)=CCOC4CC5=O)C4C3N5c7ccccc76"); assertEquals(7, m); } public void testPropertyR2() throws Exception { int m = match("[R2]", "COc1cc2c(ccnc2cc1)C(O)C4CC(CC3)C(C=C)CN34"); assertEquals(6, m); } public void testPropertyR3() throws Exception { int m = match("[R2]", "C123C5C(O)C=CC2C(N(C)CC1)Cc(ccc4O)c3c4O5"); assertEquals(4, m); } public void testPropertyR4() throws Exception { int m = match("[R2]", "C123C5C(OC(=O)C)C=CC2C(N(C)CC1)Cc(ccc4OC(=O)C)c3c4O5"); assertEquals(4, m); } public void testPropertyR5() throws Exception { int m = match("[R2]", "C1C(C)=C(C=CC(C)=CC=CC(C)=CCO)C(C)(C)C1"); assertEquals(0, m); } public void testPropertyr1() throws Exception { int m = match("[r5]", "N12CCC36C1CC(C(C2)=CCOC4CC5=O)C4C3N5c7ccccc76"); assertEquals(9, m); } public void testPropertyr2() throws Exception { int m = match("[r5]", "COc1cc2c(ccnc2cc1)C(O)C4CC(CC3)C(C=C)CN34"); assertEquals(0, m); } public void testPropertyr3() throws Exception { int m = match("[r5]", "C123C5C(O)C=CC2C(N(C)CC1)Cc(ccc4O)c3c4O5"); assertEquals(5, m); } public void testPropertyr4() throws Exception { int m = match("[r5]", "C123C5C(OC(=O)C)C=CC2C(N(C)CC1)Cc(ccc4OC(=O)C)c3c4O5");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -