@@ -333,16 +333,6 @@
Loading
333 333
                        else:
334 334
                            print('Error ReadEspfFile: encountered line not having 3 or 4 numbers')
335 335
                            return False
336 -
            # # read space
337 -
            # space = 10.0
338 -
            # for i in gridxyz:
339 -
            #     for j in gridxyz[i:]:
340 -
            #         dr = np.array(j) - np.array(i)
341 -
            #     r = np.sqrt(np.dot(dr, dr))
342 -
            #     if r == 0:
343 -
            #         pass
344 -
            #     elif r < space:
345 -
            #         space = r
346 336
347 337
            if self.prnlev >= 1:
348 338
                print()
@@ -584,6 +574,7 @@
Loading
584 574
            self.atomnames.append([])
585 575
            self.resnumbers.append([])
586 576
            self.listofpolars.append([])
577 +
            self.listofburieds.append([])
587 578
            xyzs = []
588 579
            self.nmols.append(len(xyzs))
589 580
            indices = []
@@ -664,16 +655,33 @@
Loading
664 655
                        symmetryClass.append(int(atom.GetProp('_CIPRank')))
665 656
                    # Get a list of polar atoms from rdkit
666 657
                    listofpolar  = []
658 +
                    listofburied = []
667 659
                    for atom in rdmol.GetAtoms():
668 -
                        if (atom.GetSymbol() != 'C' and atom.GetSymbol() !='H') or atom.GetIsAromatic():
660 +
                        if atom.GetSymbol() == 'C' and str(atom.GetHybridization()) != 'SP3':
669 661
                            listofpolar.append(atom.GetIdx())
662 +
                        if len([bond for bond in atom.GetBonds()]) >3:
663 +
                            listofburied.append(atom.GetIdx())
664 +
                    for atom in rdmol.GetAtoms():
665 +
                        if atom.GetSymbol() == 'H':
670 666
                            for bond in atom.GetBonds():
671 667
                                atom2 = bond.GetOtherAtom(atom)
672 -
                                if atom2.GetSymbol() == 'H':
673 -
                                    listofpolar.append(atom2.GetIdx())
674 -
                                elif atom2.GetSymbol() == 'C' and str(bond.GetBondType()) != 'SINGLE':
675 -
                                    listofpolar.append(atom2.GetIdx())
676 -
                    listofpolar = sorted(set(listofpolar))
668 +
                                if (atom2.GetSymbol() != 'C' and atom2.GetSymbol() !='H'):
669 +
                                    listofpolar.append(atom.GetIdx())
670 +
                                elif atom2.GetSymbol() == 'C' and atom2.GetIdx() in listofpolar:
671 +
                                    listofpolar.append(atom.GetIdx())
672 +
                                if atom2.GetIdx() in listofburied:
673 +
                                    listofburied.append(atom.GetIdx())
674 +
                        if (atom.GetSymbol() != 'C' and atom.GetSymbol() !='H'):
675 +
                            listofpolar.append(atom.GetIdx())
676 +
                    #     if (atom.GetSymbol() != 'C' and atom.GetSymbol() !='H') or atom.GetIsAromatic():
677 +
                    #         listofpolar.append(atom.GetIdx())
678 +
                    #         for bond in atom.GetBonds():
679 +
                    #             atom2 = bond.GetOtherAtom(atom)
680 +
                    #             if atom2.GetSymbol() == 'H':
681 +
                    #                 listofpolar.append(atom2.GetIdx())
682 +
                    #             elif atom2.GetSymbol() == 'C' and str(bond.GetBondType()) != 'SINGLE':
683 +
                    #                 listofpolar.append(atom2.GetIdx())
684 +
                    # listofpolar = sorted(set(listofpolar))
677 685
                ##########################################################################
678 686
                ### Below is the same with addCoordFiles in Molecule_OEMol             ###
679 687
                    idxof1statm, resnameof1statm = self.getidxof1statm(resnumber, resname)
@@ -747,6 +755,7 @@
Loading
747 755
                    self.atomnames.append(atomname)
748 756
                    self.resnumbers.append(resnumber)
749 757
                    self.listofpolars.append(listofpolar)
758 +
                    self.listofburieds.append(listofburied)
750 759
751 760
                    if self.inp is not None:
752 761
                        chargeinfo = self.gen_chargeinfo(self.inp.resChargeDict, newatomid, self.atomidinfo, resnumber)
@@ -764,67 +773,3 @@
Loading
764 773
                self.mols.append(rdmol)
765 774
                ### Above is the same with addCoordFiles in Molecule_OEMol             ###
766 775
                ##########################################################################
767 -
768 -
769 -
def main():
770 -
    # cwd = current working directory in which input folder exists
771 -
    cwd = os.getcwd()
772 -
    # read respyte.yml
773 -
    inp = Input('%s/input/respyte.yml' % (cwd))
774 -
    # Create molecule object
775 -
    if inp.cheminformatics == 'openeye':
776 -
        molecule = Molecule_OEMol()
777 -
    elif inp.cheminformatics == 'rdkit':
778 -
        molecule = Molecule_RDMol()
779 -
    else:
780 -
        molecule = Molecule_respyte()
781 -
    molecule.addInp(inp)
782 -
783 -
    for idx, i in enumerate(inp.nmols):
784 -
        molN = 'mol%d' % (idx+1)
785 -
        wkd = '%s/input/molecules/%s' % (cwd, molN)
786 -
        coordfilepath = []
787 -
        espffilepath = []
788 -
        for j in range(i):
789 -
            confN = 'conf%d' % (j+1)
790 -
            path = wkd + '/%s' % (confN)
791 -
            pdbfile = path + '/%s_%s.pdb' % (molN, confN)
792 -
            mol2file = path + '/%s_%s.mol2' % (molN, confN)
793 -
            xyzfile = path + '/%s_%s.xyz' % (molN, confN)
794 -
            if os.path.isfile(pdbfile):
795 -
                coordpath = pdbfile
796 -
                coordfilepath.append(coordpath)
797 -
            elif os.path.isfile(mol2file):
798 -
                coordpath = mol2file
799 -
                coordfilepath.append(coordpath)
800 -
            elif os.path.isfile(xyzfile):
801 -
                coordpath = xyzfile
802 -
                coordfilepath.append(coordpath)
803 -
                print('This folder doesn not contain pdb or mol2 file format. ')
804 -
            else:
805 -
                raise RuntimeError(" Coordinate file should have pdb or mol2 file format! ")
806 -
807 -
            espfpath = path + '/%s_%s.espf' %(molN, confN)
808 -
            if not os.path.isfile(espfpath):
809 -
                raise RuntimeError('%s file doesnt exist!!! '% espfpath)
810 -
            else:
811 -
                espffilepath.append(espfpath)
812 -
813 -
        molecule.addCoordFiles(*coordfilepath)
814 -
        # print('-----------------------------------------------------------------------------------------')
815 -
        # print('             ##   Check molecule information of %s  ' % molN )
816 -
        # print('-----------------------------------------------------------------------------------------')
817 -
        # #print('elems:       ', molecule.elems,'\n')
818 -
        # print('atom ids:    ', molecule.atomids,'\n')
819 -
        # #print('resnames:    ',molecule.resnames,'\n')
820 -
        # print('polar atoms: ', molecule.listofpolars[-1],'\n')
821 -
        # #print('charge info: ',molecule.listofchargeinfo[-1],'\n')
822 -
        # #print('atomidinfo', molecule.atomidinfo)
823 -
        #print('-----------------------------------------------------------------------------------------')
824 -
    # print(molecule.nmols, len(molecule.nmols))
825 -
    # print(len(molecule.elems), len(molecule.atomids), len(molecule.resnames), len(molecule.listofpolars), len(molecule.xyzs))
826 -
    for idx, i in enumerate(molecule.nmols):
827 -
        print('molecule %i' %(idx+1))
828 -
        print(molecule.listofpolars[idx])
829 -
if __name__ == '__main__':
830 -
    main()
Files Coverage
respyte 8.66%
Project Totals (14 files) 8.66%
8.1
TRAVIS_OS_NAME=osx
8.2
TRAVIS_OS_NAME=osx
8.3
TRAVIS_PYTHON_VERSION=3.5
TRAVIS_OS_NAME=linux
8.4
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
1
# Codecov configuration to make it a bit less noisy
2
coverage:
3
  status:
4
    patch: false
5
    project:
6
      default:
7
        threshold: 50%
8
comment:
9
  layout: "header"
10
  require_changes: false
11
  branches: null
12
  behavior: default
13
  flags: null
14
  paths: null
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading