Beispiel #1
0
 public MoleculeReference AddMolecule(MoleculeReference moleculeToBeAdded,
                                      uint firstAtomId,
                                      uint connectionAtomId,
                                      BondMultiplicity bondMultiplicity = BondMultiplicity.Single)
 {
     return(AddMolecule(moleculeToBeAdded, firstAtomId, connectionAtomId, out _, bondMultiplicity));
 }
Beispiel #2
0
 public void Dispose()
 {
     MoleculeReference.Dispose();
     AminoAcids.ForEach(aminoAcid => aminoAcid.Dispose());
     Annotations.ForEach(annotation => annotation.Dispose());
     AminoAcids.Clear();
     Annotations.Clear();
 }
Beispiel #3
0
 public Peptide(MoleculeReference moleculeReference,
                List <AminoAcidReference> aminoAcids,
                List <PeptideAnnotation <AminoAcidReference> > annotations)
 {
     MoleculeReference = moleculeReference ?? throw new ArgumentNullException(nameof(moleculeReference));
     AminoAcids        = aminoAcids;
     Annotations       = annotations;
 }
Beispiel #4
0
        public MoleculeReference AddMolecule(MoleculeReference moleculeToBeAdded,
                                             uint firstAtomId,
                                             uint connectionAtomId,
                                             out MoleculeReference convertedInputMoleculeReference,
                                             BondMultiplicity bondMultiplicity = BondMultiplicity.Single)
        {
            var mergeInfo = MoleculeStructure.AddGraph(moleculeToBeAdded.Molecule.MoleculeStructure);
            var vertex1   = connectionAtomId;
            var vertex2   = mergeInfo.VertexIdMap[moleculeToBeAdded.FirstAtomId];
            var atom1     = MoleculeStructure.GetVertexFromId(vertex1).Object;
            var atom2     = MoleculeStructure.GetVertexFromId(vertex2).Object;
            var bonds     = AtomConnector.CreateBonds(atom1, atom2, bondMultiplicity);

            foreach (var bond in bonds)
            {
                var edge = (Edge <SimpleBond>)MoleculeStructure.ConnectVertices(vertex1, vertex2);
                edge.Object = bond;
            }
            convertedInputMoleculeReference = new MoleculeReference(this,
                                                                    moleculeToBeAdded.VertexIds.Select(oldVertexId => mergeInfo.VertexIdMap[oldVertexId]),
                                                                    mergeInfo.VertexIdMap[moleculeToBeAdded.FirstAtomId],
                                                                    mergeInfo.VertexIdMap[moleculeToBeAdded.LastAtomId]);
            return(new MoleculeReference(this, firstAtomId, mergeInfo.VertexIdMap[moleculeToBeAdded.LastAtomId]));
        }
Beispiel #5
0
 public AminoAcidReference(AminoAcidName aminoAcidName, int sequenceNumber, MoleculeReference moleculeReference)
     : this(aminoAcidName, sequenceNumber, moleculeReference.Molecule, moleculeReference.VertexIds, moleculeReference.FirstAtomId, moleculeReference.LastAtomId)
 {
 }
Beispiel #6
0
 public Peptide(MoleculeReference moleculeReference,
                List <AminoAcidReference> aminoAcids)
     : this(moleculeReference, aminoAcids, new List <PeptideAnnotation <AminoAcidReference> >())
 {
 }
Beispiel #7
0
 public void Add(AminoAcidReference aminoAcid)
 {
     MoleculeReference.Add(aminoAcid, out var aminoAcidReference);
     AminoAcids.Add(new AminoAcidReference(aminoAcid.Name, aminoAcid.SequenceNumber, aminoAcidReference));
 }