idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
24,200 | public Point getLegendPosition ( int lineNr , int chainNr ) { int x = DEFAULT_X_SPACE ; int y = lineNr * DEFAULT_Y_STEP + DEFAULT_Y_SPACE ; y += chainNr * DEFAULT_LINE_SEPARATION ; Point p = new Point ( x , y ) ; return p ; } | provide the coordinates for where to draw the legend for line X and if it is chain 1 or 2 |
24,201 | public static void writeProteinSequence ( File file , Collection < ProteinSequence > proteinSequences ) throws Exception { FileOutputStream outputStream = new FileOutputStream ( file ) ; BufferedOutputStream bo = new BufferedOutputStream ( outputStream ) ; writeProteinSequence ( bo , proteinSequences ) ; bo . close ( )... | Write collection of protein sequences to a file |
24,202 | public static void writeSequence ( File file , Sequence < ? > sequence ) throws Exception { FileOutputStream outputStream = new FileOutputStream ( file ) ; BufferedOutputStream bo = new BufferedOutputStream ( outputStream ) ; writeSequences ( bo , singleSeqToCollection ( sequence ) ) ; bo . close ( ) ; outputStream . c... | Write a sequence to a file |
24,203 | public static void writeSequence ( OutputStream outputStream , Sequence < ? > sequence ) throws Exception { writeSequences ( outputStream , singleSeqToCollection ( sequence ) ) ; } | Write a sequence to OutputStream |
24,204 | public SequenceView < C > get ( int index ) { int start = toStartIndex ( index ) ; int end = index + ( getWindowSize ( ) - 1 ) ; return getBackingSequence ( ) . getSubSequence ( start , end ) ; } | Returns the window specified at the given index in offsets i . e . asking for position 2 in a moving window sequence of size 3 will get you the window starting at position 4 . |
24,205 | private Color4f getPolyhedronColor ( ) { Color4f [ ] colors = getSymmetryColors ( 5 ) ; Color4f strongestColor = colors [ 4 ] ; Color4f complement = new Color4f ( Color . WHITE ) ; complement . sub ( strongestColor ) ; return complement ; } | Return a color that is complementary to the symmetry color |
24,206 | public static < C extends Compound > int countCompounds ( Sequence < C > sequence , C ... compounds ) { int count = 0 ; Map < C , Integer > compositon = getComposition ( sequence ) ; for ( C compound : compounds ) { if ( compositon . containsKey ( compound ) ) { count = compositon . get ( compound ) + count ; } } retur... | For the given vargs of compounds this method counts the number of times those compounds appear in the given sequence |
24,207 | public static int countGC ( Sequence < NucleotideCompound > sequence ) { CompoundSet < NucleotideCompound > cs = sequence . getCompoundSet ( ) ; NucleotideCompound G = cs . getCompoundForString ( "G" ) ; NucleotideCompound C = cs . getCompoundForString ( "C" ) ; NucleotideCompound g = cs . getCompoundForString ( "g" ) ... | Returns the count of GC in the given sequence |
24,208 | public static int countAT ( Sequence < NucleotideCompound > sequence ) { CompoundSet < NucleotideCompound > cs = sequence . getCompoundSet ( ) ; NucleotideCompound A = cs . getCompoundForString ( "A" ) ; NucleotideCompound T = cs . getCompoundForString ( "T" ) ; NucleotideCompound a = cs . getCompoundForString ( "a" ) ... | Returns the count of AT in the given sequence |
24,209 | public static < C extends Compound > Map < C , Integer > getComposition ( Sequence < C > sequence ) { Map < C , Integer > results = new HashMap < C , Integer > ( ) ; for ( C currentCompound : sequence ) { Integer currentInteger = results . get ( currentCompound ) ; if ( currentInteger == null ) currentInteger = 0 ; cur... | Does a linear scan over the given Sequence and records the number of times each base appears . The returned map will return 0 if a compound is asked for and the Map has no record of it . |
24,210 | public static < C extends Compound > void write ( Appendable appendable , Sequence < C > sequence ) throws IOException { for ( C compound : sequence ) { appendable . append ( compound . toString ( ) ) ; } } | Used as a way of sending a Sequence to a writer without the cost of converting to a full length String and then writing the data out |
24,211 | public static < C extends Compound > int indexOf ( Sequence < C > sequence , C compound ) { int index = 1 ; for ( C currentCompound : sequence ) { if ( currentCompound . equals ( compound ) ) { return index ; } index ++ ; } return 0 ; } | Performs a linear search of the given Sequence for the given compound . Once we find the compound we return the position . |
24,212 | public static < C extends Compound > Iterator < C > createIterator ( Sequence < C > sequence ) { return new SequenceIterator < C > ( sequence ) ; } | Creates a simple sequence iterator which moves through a sequence going from 1 to the length of the Sequence . Modification of the Sequence is not allowed . |
24,213 | public static < C extends Compound > SequenceView < C > createSubSequence ( Sequence < C > sequence , int start , int end ) { return new SequenceProxyView < C > ( sequence , start , end ) ; } | Creates a simple sub sequence view delimited by the given start and end . |
24,214 | public static < C extends Compound > String checksum ( Sequence < C > sequence ) { CRC64Checksum checksum = new CRC64Checksum ( ) ; for ( C compound : sequence ) { checksum . update ( compound . getShortName ( ) ) ; } return checksum . toString ( ) ; } | Performs a simple CRC64 checksum on any given sequence . |
24,215 | public static < C extends Compound > List < SequenceView < C > > overlappingKmers ( Sequence < C > sequence , int kmer ) { List < SequenceView < C > > l = new ArrayList < SequenceView < C > > ( ) ; List < Iterator < SequenceView < C > > > windows = new ArrayList < Iterator < SequenceView < C > > > ( ) ; for ( int i = 1... | Used to generate overlapping k - mers such i . e . ATGTA will give rise to ATG TGT & GTA |
24,216 | public static < C extends Compound > boolean sequenceEqualityIgnoreCase ( Sequence < C > source , Sequence < C > target ) { return baseSequenceEquality ( source , target , true ) ; } | A case - insensitive manner of comparing two sequence objects together . We will throw out any compounds which fail to match on their sequence length & compound sets used . The code will also bail out the moment we find something is wrong with a Sequence . Cost to run is linear to the length of the Sequence . |
24,217 | public static < C extends Compound > boolean sequenceEquality ( Sequence < C > source , Sequence < C > target ) { return baseSequenceEquality ( source , target , false ) ; } | A case - sensitive manner of comparing two sequence objects together . We will throw out any compounds which fail to match on their sequence length & compound sets used . The code will also bail out the moment we find something is wrong with a Sequence . Cost to run is linear to the length of the Sequence . |
24,218 | public boolean hasNext ( int windowSize , int increment ) { if ( windowSize <= 0 ) { throw new IllegalArgumentException ( "Window size must be positive." ) ; } try { if ( increment > 0 ) { return windowSize == mBounds . suffix ( mPosition ) . prefix ( windowSize ) . length ( ) ; } else { if ( mPosition == 0 ) { return ... | Check if next window of specified size is available . |
24,219 | public Location next ( int windowSize , int increment ) { if ( windowSize <= 0 ) { throw new IllegalArgumentException ( "Window size must be positive." ) ; } if ( increment == 0 ) { throw new IllegalArgumentException ( "Increment must be non-zero." ) ; } Location r ; try { if ( increment > 0 ) { r = mBounds . suffix ( ... | Get next window of specified size then increment position by specified amount . |
24,220 | public void setProxySequenceReader ( SequenceReader < C > proxyLoader ) { this . sequenceStorage = proxyLoader ; if ( proxyLoader instanceof FeaturesKeyWordInterface ) { this . setFeaturesKeyWord ( ( FeaturesKeyWordInterface ) sequenceStorage ) ; } if ( proxyLoader instanceof DatabaseReferenceInterface ) { this . setDa... | Very important method that allows external mappings of sequence data and features . This method will gain additional interface inspection that allows external data sources with knowledge of features for a sequence to be supported . |
24,221 | public String getSource ( ) { if ( source != null ) { return source ; } if ( parentSequence != null ) { return parentSequence . getSource ( ) ; } return null ; } | Added support for the source of this sequence for GFF3 export If a sub sequence doesn t have source then check for parent source |
24,222 | public List < FeatureInterface < AbstractSequence < C > , C > > getFeatures ( int bioSequencePosition ) { ArrayList < FeatureInterface < AbstractSequence < C > , C > > featureHits = new ArrayList < FeatureInterface < AbstractSequence < C > , C > > ( ) ; if ( features != null ) { for ( FeatureInterface < AbstractSequenc... | Return features at a sequence position |
24,223 | public void addFeature ( int bioStart , int bioEnd , FeatureInterface < AbstractSequence < C > , C > feature ) { SequenceLocation < AbstractSequence < C > , C > sequenceLocation = new SequenceLocation < AbstractSequence < C > , C > ( bioStart , bioEnd , this ) ; feature . setLocation ( sequenceLocation ) ; addFeature (... | Method to help set the proper details for a feature as it relates to a sequence where the feature needs to have a location on the sequence |
24,224 | public void addFeature ( FeatureInterface < AbstractSequence < C > , C > feature ) { features . add ( feature ) ; ArrayList < FeatureInterface < AbstractSequence < C > , C > > featureList = groupedFeatures . get ( feature . getType ( ) ) ; if ( featureList == null ) { featureList = new ArrayList < FeatureInterface < Ab... | Add a feature to this sequence . The feature will be added to the collection where the order is start position and if more than one feature at the same start position then longest is added first . This helps on doing feature layout for displaying features in SequenceFeaturePanel |
24,225 | public void removeFeature ( FeatureInterface < AbstractSequence < C > , C > feature ) { features . remove ( feature ) ; ArrayList < FeatureInterface < AbstractSequence < C > , C > > featureList = groupedFeatures . get ( feature . getType ( ) ) ; if ( featureList != null ) { featureList . remove ( feature ) ; if ( featu... | Remove a feature from the sequence |
24,226 | public Point3i getCellIndices ( Tuple3d pt ) { Point3d p = new Point3d ( pt ) ; this . transfToCrystal ( p ) ; int x = ( int ) Math . floor ( p . x ) ; int y = ( int ) Math . floor ( p . y ) ; int z = ( int ) Math . floor ( p . z ) ; return new Point3i ( x , y , z ) ; } | Get the index of a unit cell to which the query point belongs . |
24,227 | public void transfToOriginCell ( Tuple3d [ ] points , Tuple3d reference ) { reference = new Point3d ( reference ) ; transfToCrystal ( reference ) ; int x = ( int ) Math . floor ( reference . x ) ; int y = ( int ) Math . floor ( reference . y ) ; int z = ( int ) Math . floor ( reference . z ) ; for ( Tuple3d point : poi... | Converts a set of points so that the reference point falls in the unit cell . |
24,228 | public double getMaxDimension ( ) { if ( maxDimension != 0 ) { return maxDimension ; } Point3d vert0 = new Point3d ( 0 , 0 , 0 ) ; Point3d vert1 = new Point3d ( 1 , 0 , 0 ) ; transfToOrthonormal ( vert1 ) ; Point3d vert2 = new Point3d ( 0 , 1 , 0 ) ; transfToOrthonormal ( vert2 ) ; Point3d vert3 = new Point3d ( 0 , 0 ,... | Gets the maximum dimension of the unit cell . |
24,229 | private SiftsSegment getSiftsSegment ( Element el ) { String segId = el . getAttribute ( "segId" ) ; String start = el . getAttribute ( "start" ) ; String end = el . getAttribute ( "end" ) ; SiftsSegment seg = new SiftsSegment ( segId , start , end ) ; if ( debug ) System . out . println ( "parsed " + seg ) ; NodeList ... | segId = 4hhb_A_1_140 start = 1 end = 140 |
24,230 | public static Color rotateHue ( Color color , float fraction ) { float [ ] af = Color . RGBtoHSB ( color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) , null ) ; float hue = af [ 0 ] ; float saturation = af [ 1 ] ; float brightness = af [ 2 ] ; float hueNew = hue + fraction ; Color hsb = Color . getHSBColor... | Rotate a color through HSB space |
24,231 | protected PdbPairsMessage getAlignmentPairsFromServer ( ) { String url = params . getServer ( ) ; int nrPairs = params . getStepSize ( ) ; if ( maxNrAlignments < nrPairs ) nrPairs = maxNrAlignments ; SortedSet < PdbPair > allPairs = new TreeSet < PdbPair > ( ) ; PdbPairsMessage msg = null ; try { if ( progressListeners... | talk to centralized server and fetch all alignments to run . |
24,232 | public static Map < Integer , Integer > alignmentAsMap ( AFPChain afpChain ) throws StructureException { Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; if ( afpChain . getAlnLength ( ) < 1 ) { return map ; } int [ ] [ ] [ ] optAln = afpChain . getOptAln ( ) ; int [ ] optLen = afpChain . getOptL... | Creates a Map specifying the alignment as a mapping between residue indices of protein 1 and residue indices of protein 2 . |
24,233 | public static int getSymmetryOrder ( Map < Integer , Integer > alignment , Map < Integer , Integer > identity , final int maxSymmetry , final float minimumMetricChange ) { List < Integer > preimage = new ArrayList < Integer > ( alignment . keySet ( ) ) ; List < Integer > image = new ArrayList < Integer > ( preimage ) ;... | Tries to detect symmetry in an alignment . |
24,234 | public static int getSymmetryOrder ( AFPChain afpChain , int maxSymmetry , float minimumMetricChange ) throws StructureException { Map < Integer , Integer > alignment = AlignmentTools . alignmentAsMap ( afpChain ) ; Map < Integer , Integer > identity = guessSequentialAlignment ( alignment , true ) ; return AlignmentToo... | Guesses the order of symmetry in an alignment |
24,235 | public static Map < Integer , Integer > guessSequentialAlignment ( Map < Integer , Integer > alignment , boolean inverseAlignment ) { Map < Integer , Integer > identity = new HashMap < Integer , Integer > ( ) ; SortedSet < Integer > aligned1 = new TreeSet < Integer > ( ) ; SortedSet < Integer > aligned2 = new TreeSet <... | Takes a potentially non - sequential alignment and guesses a sequential version of it . Residues from each structure are sorted sequentially and then compared directly . |
24,236 | public static AFPChain createAFPChain ( Atom [ ] ca1 , Atom [ ] ca2 , ResidueNumber [ ] aligned1 , ResidueNumber [ ] aligned2 ) throws StructureException { int alnLen = aligned1 . length ; if ( alnLen != aligned2 . length ) { throw new IllegalArgumentException ( "Alignment lengths are not equal" ) ; } AFPChain a = new ... | Fundamentally an alignment is just a list of aligned residues in each protein . This method converts two lists of ResidueNumbers into an AFPChain . |
24,237 | public static AFPChain replaceOptAln ( int [ ] [ ] [ ] newAlgn , AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 ) throws StructureException { int order = newAlgn . length ; int [ ] optLens = new int [ order ] ; for ( int s = 0 ; s < order ; s ++ ) { optLens [ s ] = newAlgn [ s ] [ 0 ] . length ; } int optLength = 0 ; ... | It replaces an optimal alignment of an AFPChain and calculates all the new alignment scores and variables . |
24,238 | public static AFPChain replaceOptAln ( AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 , Map < Integer , Integer > alignment ) throws StructureException { Integer [ ] res1 = alignment . keySet ( ) . toArray ( new Integer [ 0 ] ) ; Arrays . sort ( res1 ) ; List < Integer > blockLens = new ArrayList < Integer > ( 2 ) ; i... | Takes an AFPChain and replaces the optimal alignment based on an alignment map |
24,239 | public static < S , T > String toConciseAlignmentString ( Map < S , T > alignment , Map < T , S > identity ) { Map < S , T > alig = new HashMap < S , T > ( alignment ) ; Map < S , List < S > > inverse = new HashMap < S , List < S > > ( ) ; for ( Entry < S , T > e : alig . entrySet ( ) ) { S val = identity . get ( e . g... | Print an alignment map in a concise representation . Edges are given as two numbers separated by > . They are chained together where possible or separated by spaces where disjoint or branched . |
24,240 | public static int [ ] calculateBlockGap ( int [ ] [ ] [ ] optAln ) { int [ ] blockGap = new int [ optAln . length ] ; for ( int i = 0 ; i < optAln . length ; i ++ ) { int gaps = 0 ; int last1 = 0 ; int last2 = 0 ; for ( int j = 0 ; j < optAln [ i ] [ 0 ] . length ; j ++ ) { if ( j == 0 ) { last1 = optAln [ i ] [ 0 ] [ ... | Method that calculates the number of gaps in each subunit block of an optimal AFP alignment . |
24,241 | public static final List < Chain > getAlignedModel ( Atom [ ] ca ) { List < Chain > model = new ArrayList < Chain > ( ) ; for ( Atom a : ca ) { Group g = a . getGroup ( ) ; Chain parentC = g . getChain ( ) ; Chain newChain = null ; for ( Chain c : model ) { if ( c . getId ( ) . equals ( parentC . getId ( ) ) ) { newCha... | get an artificial List of chains containing the Atoms and groups . Does NOT rotate anything . |
24,242 | public static final Structure getAlignedStructure ( Atom [ ] ca1 , Atom [ ] ca2 ) throws StructureException { Structure s = new StructureImpl ( ) ; List < Chain > model1 = getAlignedModel ( ca1 ) ; s . addModel ( model1 ) ; List < Chain > model2 = getAlignedModel ( ca2 ) ; s . addModel ( model2 ) ; return s ; } | Get an artifical Structure containing both chains . Does NOT rotate anything |
24,243 | public static void shiftCA2 ( AFPChain afpChain , Atom [ ] ca2 , Matrix m , Atom shift , Group [ ] twistedGroups ) { int i = - 1 ; for ( Atom a : ca2 ) { i ++ ; Group g = a . getGroup ( ) ; Calc . rotate ( g , m ) ; Calc . shift ( g , shift ) ; if ( g . hasAltLoc ( ) ) { for ( Group alt : g . getAltLocs ( ) ) { for ( A... | only shift CA positions . |
24,244 | public static void fillAlignedAtomArrays ( AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 , Atom [ ] ca1aligned , Atom [ ] ca2aligned ) { int pos = 0 ; int [ ] blockLens = afpChain . getOptLen ( ) ; int [ ] [ ] [ ] optAln = afpChain . getOptAln ( ) ; assert ( afpChain . getBlockNum ( ) <= optAln . length ) ; for ( int... | Fill the aligned Atom arrays with the equivalent residues in the afpChain . |
24,245 | public static AFPChain deleteHighestDistanceColumn ( AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 ) throws StructureException { int [ ] [ ] [ ] optAln = afpChain . getOptAln ( ) ; int maxBlock = 0 ; int maxPos = 0 ; double maxDistance = Double . MIN_VALUE ; for ( int b = 0 ; b < optAln . length ; b ++ ) { for ( int ... | Find the alignment position with the highest atomic distance between the equivalent atomic positions of the arrays and remove it from the alignment . |
24,246 | public static AFPChain deleteColumn ( AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 , int block , int pos ) throws StructureException { if ( afpChain . getBlockNum ( ) <= block ) { throw new IndexOutOfBoundsException ( String . format ( "Block index requested (%d) is higher than the total number of AFPChain blocks (%... | Delete an alignment position from the original alignment object . |
24,247 | public void identify ( final Structure structure , final Set < ProteinModification > potentialModifications ) { if ( structure == null ) { throw new IllegalArgumentException ( "Null structure." ) ; } identify ( structure . getChains ( ) , potentialModifications ) ; } | Identify a set of modifications in a structure . |
24,248 | public void identify ( final Chain chain , final Set < ProteinModification > potentialModifications ) { identify ( Collections . singletonList ( chain ) , potentialModifications ) ; } | Identify a set of modifications in a a chains . |
24,249 | public void identify ( final List < Chain > chains , final Set < ProteinModification > potentialModifications ) { if ( chains == null ) { throw new IllegalArgumentException ( "Null structure." ) ; } if ( potentialModifications == null ) { throw new IllegalArgumentException ( "Null potentialModifications." ) ; } reset (... | Identify a set of modifications in a a list of chains . |
24,250 | private void identifyAdditionalAttachments ( ModifiedCompound mc , List < Group > ligands , List < Chain > chains ) { if ( ligands . isEmpty ( ) ) { return ; } List < Group > identifiedGroups = new ArrayList < Group > ( ) ; for ( StructureGroup num : mc . getGroups ( false ) ) { Group group ; try { ResidueNumber resNum... | identify additional groups that are not directly attached to amino acids . |
24,251 | private void mergeModComps ( List < ModifiedCompound > modComps ) { TreeSet < Integer > remove = new TreeSet < Integer > ( ) ; int n = modComps . size ( ) ; for ( int icurr = 1 ; icurr < n ; icurr ++ ) { ModifiedCompound curr = modComps . get ( icurr ) ; String id = curr . getModification ( ) . getId ( ) ; if ( Protein... | Merge identified modified compounds if linked . |
24,252 | private void recordUnidentifiableAtomLinkages ( List < ModifiedCompound > modComps , List < Group > ligands ) { Set < StructureAtomLinkage > identifiedLinkages = new HashSet < StructureAtomLinkage > ( ) ; for ( ModifiedCompound mc : modComps ) { identifiedLinkages . addAll ( mc . getAtomLinkages ( ) ) ; } int nRes = re... | Record unidentifiable atom linkages in a chain . Only linkages between two residues or one residue and one ligand will be recorded . |
24,253 | private List < List < Atom [ ] > > getMatchedAtomsOfLinkages ( ModificationCondition condition , Map < Component , Set < Group > > mapCompGroups ) { List < ModificationLinkage > linkages = condition . getLinkages ( ) ; int nLink = linkages . size ( ) ; List < List < Atom [ ] > > matchedAtomsOfLinkages = new ArrayList <... | Get matched atoms for all linkages . |
24,254 | private void assembleLinkages ( List < List < Atom [ ] > > matchedAtomsOfLinkages , ProteinModification mod , List < ModifiedCompound > ret ) { ModificationCondition condition = mod . getCondition ( ) ; List < ModificationLinkage > modLinks = condition . getLinkages ( ) ; int nLink = matchedAtomsOfLinkages . size ( ) ;... | Assembly the matched linkages |
24,255 | protected int getSeqPos ( int panelPos ) { int seqPos = Math . round ( ( panelPos - SequenceScalePanel . DEFAULT_X_START ) / scale ) ; if ( seqPos < 0 ) seqPos = 0 ; return seqPos ; } | start counting at 0 ... |
24,256 | public String getOrientationName ( int index ) { if ( getAxisTransformation ( ) . getRotationGroup ( ) . getPointGroup ( ) . equals ( "C2" ) ) { if ( index == 0 ) { return "Front C2 axis" ; } else if ( index == 2 ) { return "Back C2 axis" ; } } return getPolyhedron ( ) . getViewName ( index ) ; } | Returns the name of a specific orientation |
24,257 | public XMLWriter toXML ( PrintWriter pw ) throws IOException { XMLWriter xw = new PrettyXMLWriter ( pw ) ; toXML ( xw ) ; return xw ; } | convert Configuration to an XML file so it can be serialized |
24,258 | public XMLWriter toXML ( XMLWriter xw ) throws IOException { xw . printRaw ( "<?xml version='1.0' standalone='no' ?>" ) ; xw . openTag ( "JFatCatConfig" ) ; xw . openTag ( "PDBFILEPATH" ) ; String tempdir = System . getProperty ( TMP_DIR ) ; if ( ! pdbFilePath . equals ( tempdir ) ) xw . attribute ( "path" , pdbFilePat... | convert Configuration to an XML file so it can be serialized add to an already existing xml file . |
24,259 | private void mapIds ( ) { if ( queryReferences != null ) { queryReferencesMap = new HashMap < String , Sequence > ( queryReferences . size ( ) ) ; for ( int counter = 0 ; counter < queryReferences . size ( ) ; counter ++ ) { String id = "Query_" + ( counter + 1 ) ; queryReferencesMap . put ( id , queryReferences . get ... | fill the map association between sequences an a unique id |
24,260 | public void sort ( ) { Collections . sort ( list ) ; int i = 1 ; for ( StructureInterface interf : list ) { interf . setId ( i ) ; i ++ ; } } | Sorts the interface list and reassigns ids based on new sorting |
24,261 | public void addNcsEquivalent ( StructureInterface interfaceNew , StructureInterface interfaceRef ) { this . add ( interfaceNew ) ; if ( clustersNcs == null ) { clustersNcs = new ArrayList < > ( ) ; } if ( interfaceRef == null ) { StructureInterfaceCluster newCluster = new StructureInterfaceCluster ( ) ; newCluster . ad... | Add an interface to the list possibly defining it as NCS - equivalent to an interface already in the list . Used to build up the NCS clustering . |
24,262 | public static StructureInterfaceList calculateInterfaces ( Structure struc ) { CrystalBuilder builder = new CrystalBuilder ( struc ) ; StructureInterfaceList interfaces = builder . getUniqueInterfaces ( ) ; logger . debug ( "Calculating ASA for " + interfaces . size ( ) + " potential interfaces" ) ; interfaces . calcAs... | Calculates the interfaces for a structure using default parameters |
24,263 | public static String getNewickString ( Phylogeny phylo , boolean writeDistances ) throws IOException { PhylogenyWriter w = new PhylogenyWriter ( ) ; StringBuffer newickString = w . toNewHampshire ( phylo , writeDistances ) ; return newickString . toString ( ) ; } | Convert a Phylogenetic tree to its Newick representation so that it can be exported to an external application . |
24,264 | public static BasicSymmetricalDistanceMatrix cloneDM ( BasicSymmetricalDistanceMatrix distM ) { int n = distM . getSize ( ) ; BasicSymmetricalDistanceMatrix cloneDM = new BasicSymmetricalDistanceMatrix ( n ) ; for ( int i = 0 ; i < n ; i ++ ) { cloneDM . setIdentifier ( i , distM . getIdentifier ( i ) ) ; for ( int j =... | Helper function to clone a forester symmetrical DistanceMatrix . |
24,265 | public List < AtomContact > getContactsWithinDistance ( double distance ) { List < AtomContact > list = new ArrayList < AtomContact > ( ) ; for ( AtomContact contact : this . atomContacts ) { if ( contact . getDistance ( ) < distance ) { list . add ( contact ) ; } } return list ; } | Returns the list of atom contacts in this GroupContact that are within the given distance . |
24,266 | public void computeMolecularWeight ( ElementTable eTable ) { this . aaSymbol2MolecularWeight = new HashMap < Character , Double > ( ) ; for ( AminoAcidComposition a : aminoacid ) { if ( a . getSymbol ( ) . length ( ) != 1 ) { throw new Error ( a . getSymbol ( ) + " is not allowed. Symbols must be single character.\r\nP... | Computes and store the molecular weight of each amino acid by its symbol in aaSymbol2MolecularWeight . |
24,267 | public boolean hasContact ( Group group1 , Group group2 ) { return hasContact ( group1 . getResidueNumber ( ) , group2 . getResidueNumber ( ) ) ; } | Tell whether the given group pair is a contact in this GroupContactSet the comparison is done by matching residue numbers and chain identifiers |
24,268 | public boolean hasContact ( ResidueNumber resNumber1 , ResidueNumber resNumber2 ) { return contacts . containsKey ( new Pair < ResidueNumber > ( resNumber1 , resNumber2 ) ) ; } | Tell whether the given pair is a contact in this GroupContactSet the comparison is done by matching residue numbers and chain identifiers |
24,269 | public GroupContact getContact ( Group group1 , Group group2 ) { return contacts . get ( new Pair < ResidueNumber > ( group1 . getResidueNumber ( ) , group2 . getResidueNumber ( ) ) ) ; } | Returns the corresponding GroupContact or null if no contact exists between the 2 given groups |
24,270 | public Structure mutate ( Structure struc , String chainId , String pdbResnum , String newType ) throws PDBParseException { Structure newstruc = new StructureImpl ( ) ; List < Chain > chains = struc . getChains ( 0 ) ; for ( Chain c : chains ) { if ( c . getName ( ) . equals ( chainId ) ) { Chain newchain = new ChainIm... | creates a new structure which is identical with the original one . only one amino acid will be different . |
24,271 | public AminoAcid mutateResidue ( AminoAcid oldAmino , String newType ) throws PDBParseException { AminoAcid newgroup = new AminoAcidImpl ( ) ; newgroup . setResidueNumber ( oldAmino . getResidueNumber ( ) ) ; newgroup . setPDBName ( newType ) ; AtomIterator aiter = new AtomIterator ( oldAmino ) ; while ( aiter . hasNex... | create a new residue which is of the new type . Only the atoms N Ca C O Cb will be considered . |
24,272 | public final static float PID ( String seq1 , String seq2 ) { return PID ( seq1 , seq2 , 0 , seq1 . length ( ) ) ; } | this is a gapped PID calculation |
24,273 | public final static float PID ( String seq1 , String seq2 , int start , int end ) { int s1len = seq1 . length ( ) ; int s2len = seq2 . length ( ) ; int len = Math . min ( s1len , s2len ) ; if ( end < len ) { len = end ; } if ( len < start ) { start = len - 1 ; } int bad = 0 ; char chr1 ; char chr2 ; for ( int i = start... | Another pid with region specification |
24,274 | private boolean completeRotationGroup ( Rotation ... additionalRots ) { PermutationGroup g = new PermutationGroup ( ) ; for ( Rotation s : rotations ) { g . addPermutation ( s . getPermutation ( ) ) ; } for ( Rotation s : additionalRots ) { g . addPermutation ( s . getPermutation ( ) ) ; assert evaluatedPermutations . ... | Combine current rotations to make all possible permutations . If these are all valid add them to the rotations |
24,275 | private List < Double > getAngles ( ) { int n = subunits . getSubunitCount ( ) ; if ( n % 60 == 0 && isSpherical ( ) ) { n = 60 ; } List < Integer > folds = subunits . getFolds ( ) ; List < Double > angles = new ArrayList < Double > ( folds . size ( ) - 1 ) ; for ( int fold : folds ) { if ( fold > 0 && fold <= n ) { an... | Get valid rotation angles given the number of subunits |
24,276 | private Rotation isValidPermutation ( List < Integer > permutation ) { if ( permutation . size ( ) == 0 ) { return null ; } if ( evaluatedPermutations . containsKey ( permutation ) ) { return evaluatedPermutations . get ( permutation ) ; } if ( ! isAllowedPermutation ( permutation ) ) { evaluatedPermutations . put ( pe... | Checks if a particular permutation is allowed and superimposes well . Caches results . |
24,277 | private boolean isAllowedPermutation ( List < Integer > permutation ) { List < Integer > seqClusterId = subunits . getClusterIds ( ) ; int selfaligned = 0 ; for ( int i = 0 ; i < permutation . size ( ) ; i ++ ) { int j = permutation . get ( i ) ; if ( seqClusterId . get ( i ) != seqClusterId . get ( j ) ) { return fals... | The permutation must map all subunits onto an equivalent subunit and no subunit onto itself |
24,278 | private List < Integer > getPermutation ( ) { List < Integer > permutation = new ArrayList < Integer > ( transformedCoords . length ) ; double sum = 0.0f ; for ( Point3d t : transformedCoords ) { List < Integer > neighbors = box . getNeighborsWithCache ( t ) ; int closest = - 1 ; double minDist = Double . MAX_VALUE ; f... | Compare this . transformedCoords with the original coords . For each subunit return the transformed subunit with the closest position . |
24,279 | public static Structure readStructure ( String pdbId , int bioAssemblyId ) { pdbId = pdbId . toLowerCase ( ) ; AtomCache cache = new AtomCache ( ) ; cache . setUseMmCif ( true ) ; FileParsingParameters p = cache . getFileParsingParams ( ) ; p . setAtomCaThreshold ( Integer . MAX_VALUE ) ; p . setParseBioAssembly ( true... | Load a specific biological assembly for a PDB entry |
24,280 | public List < SecStrucState > calculate ( Structure s , boolean assign ) throws StructureException { List < SecStrucState > secstruc = new ArrayList < SecStrucState > ( ) ; for ( int i = 0 ; i < s . nrModels ( ) ; i ++ ) { ladders = new ArrayList < Ladder > ( ) ; bridges = new ArrayList < BetaBridge > ( ) ; groups = in... | Predicts the secondary structure of this Structure object using a DSSP implementation . |
24,281 | private void initContactSet ( ) { atoms = new Atom [ groups . length ] ; indResMap = new HashMap < > ( ) ; for ( int i = 0 ; i < groups . length ; i ++ ) { SecStrucGroup one = groups [ i ] ; indResMap . put ( one . getResidueNumber ( ) , i ) ; atoms [ i ] = one . getCA ( ) ; } Grid grid = new Grid ( CA_MIN_DIST ) ; if ... | Function to generate the contact sets |
24,282 | public String printDSSP ( ) { StringBuffer buf = new StringBuffer ( ) ; String nl = System . getProperty ( "line.separator" ) ; buf . append ( "==== Secondary Structure Definition by BioJava" + " DSSP implementation, Version October 2015 ====" + nl ) ; buf . append ( " # RESIDUE AA STRUCTURE BP1 BP2 ACC " + "N-H... | Generate a DSSP file format ouput String of this SS prediction . |
24,283 | public String printFASTA ( ) { StringBuffer buf = new StringBuffer ( ) ; String nl = System . getProperty ( "line.separator" ) ; buf . append ( ">" + groups [ 0 ] . getChain ( ) . getStructure ( ) . getIdentifier ( ) + nl ) ; for ( int g = 0 ; g < groups . length ; g ++ ) { buf . append ( getSecStrucState ( g ) . getTy... | Generate a FASTA sequence with the SS annotation letters in the aminoacid sequence order . |
24,284 | private void calculateHAtoms ( ) throws StructureException { for ( int i = 0 ; i < groups . length - 1 ; i ++ ) { SecStrucGroup a = groups [ i ] ; SecStrucGroup b = groups [ i + 1 ] ; if ( ! b . hasAtom ( "H" ) ) { Atom H = calcSimple_H ( a . getC ( ) , a . getO ( ) , b . getN ( ) ) ; b . setH ( H ) ; } } } | Calculate the coordinates of the H atoms . They are usually missing in the PDB files as only few experimental methods allow to resolve their location . |
24,285 | private void calculateHBonds ( ) { if ( groups . length < 5 ) return ; Iterator < AtomContact > otu = contactSet . iterator ( ) ; while ( otu . hasNext ( ) ) { AtomContact ac = otu . next ( ) ; Pair < Atom > pair = ac . getPair ( ) ; Group g1 = pair . getFirst ( ) . getGroup ( ) ; Group g2 = pair . getSecond ( ) . getG... | Calculate the HBonds between different groups . see Creighton page 147 f Modified to use only the contact map |
24,286 | private void trackHBondEnergy ( int i , int j , double energy ) { if ( groups [ i ] . getPDBName ( ) . equals ( "PRO" ) ) { logger . debug ( "Ignore: PRO {}" , groups [ i ] . getResidueNumber ( ) ) ; return ; } SecStrucState stateOne = getSecStrucState ( i ) ; SecStrucState stateTwo = getSecStrucState ( j ) ; double ac... | Store Hbonds in the Groups . DSSP allows two HBonds per aminoacids to allow bifurcated bonds . |
24,287 | private void calculateTurns ( ) { for ( int i = 0 ; i < groups . length ; i ++ ) { for ( int turn = 3 ; turn <= 5 ; turn ++ ) { if ( i + turn >= groups . length ) continue ; if ( isBonded ( i , i + turn ) ) { logger . debug ( "Turn at ({},{}) turn {}" , i , ( i + turn ) , turn ) ; getSecStrucState ( i ) . setTurn ( '>'... | Detect helical turn patterns . |
24,288 | @ SuppressWarnings ( "unused" ) private static Atom calc_H ( Atom C , Atom N , Atom CA ) throws StructureException { Atom nc = Calc . subtract ( N , C ) ; Atom nca = Calc . subtract ( N , CA ) ; Atom u_nc = Calc . unitVector ( nc ) ; Atom u_nca = Calc . unitVector ( nca ) ; Atom added = Calc . add ( u_nc , u_nca ) ; At... | Use unit vectors NC and NCalpha Add them . Calc unit vector and substract it from N . C coordinates are from amino acid i - 1 N CA atoms from amino acid i |
24,289 | private void setSecStrucType ( int pos , SecStrucType type ) { SecStrucState ss = getSecStrucState ( pos ) ; if ( type . compareTo ( ss . getType ( ) ) < 0 ) ss . setType ( type ) ; } | Set the new type only if it has more preference than the current residue SS type . |
24,290 | public AFPChain align ( Atom [ ] ca1 , Atom [ ] ca2 , Object param ) throws StructureException { if ( ! ( param instanceof CeParameters ) ) throw new IllegalArgumentException ( "CE algorithm needs an object of call CeParameters as argument." ) ; params = ( CeParameters ) param ; ca2clone = new Atom [ ca2 . length ] ; i... | Align ca2 onto ca1 . |
24,291 | public void remark800toPDB ( StringBuffer stringBuffer ) { stringBuffer . append ( String . format ( Locale . UK , "REMARK 800 SITE_IDENTIFIER: %-52s%s" , siteID , lineEnd ) ) ; stringBuffer . append ( String . format ( Locale . UK , "REMARK 800 EVIDENCE_CODE: %-54s%s" , evCode , lineEnd ) ) ; stringBuffer . append ( S... | Appends the REMARK 800 section pertaining to the site onto the end of the StringBuffer provided . |
24,292 | private double normScore ( double score , double rmsd , int optLen , int r ) { double score1 = score ; if ( r > 0 ) score1 /= Math . sqrt ( r + 1 ) ; if ( rmsd < 0.5 ) score1 *= Math . sqrt ( ( optLen ) / 0.5 ) ; else score1 *= Math . sqrt ( ( optLen ) / rmsd ) ; return score1 ; } | the chaining score is normalized by rmsd twist and optimal alignment length |
24,293 | public static String cleanSequence ( String sequence ) { assert sequence != null ; final Matcher m = SequenceUtil . WHITE_SPACE . matcher ( sequence ) ; sequence = m . replaceAll ( "" ) . toUpperCase ( ) ; return sequence ; } | Removes all whitespace chars in the sequence string |
24,294 | public static String deepCleanSequence ( String sequence ) { sequence = SequenceUtil . cleanSequence ( sequence ) ; sequence = SequenceUtil . DIGIT . matcher ( sequence ) . replaceAll ( "" ) ; sequence = SequenceUtil . NONWORD . matcher ( sequence ) . replaceAll ( "" ) ; final Pattern othernonSeqChars = Pattern . compi... | Removes all special characters and digits as well as whitespace chars from the sequence |
24,295 | public static boolean isAmbiguosProtein ( String sequence ) { sequence = SequenceUtil . cleanSequence ( sequence ) ; if ( SequenceUtil . isNonAmbNucleotideSequence ( sequence ) ) { return false ; } if ( SequenceUtil . DIGIT . matcher ( sequence ) . find ( ) ) { return false ; } if ( SequenceUtil . NON_AA . matcher ( se... | Check whether the sequence confirms to amboguous protein sequence |
24,296 | public static void writeFasta ( final OutputStream outstream , final List < FastaSequence > sequences , final int width ) throws IOException { final OutputStreamWriter writer = new OutputStreamWriter ( outstream ) ; final BufferedWriter fastawriter = new BufferedWriter ( writer ) ; for ( final FastaSequence fs : sequen... | Writes list of FastaSequeces into the outstream formatting the sequence so that it contains width chars on each line |
24,297 | public static List < FastaSequence > readFasta ( final InputStream inStream ) throws IOException { final List < FastaSequence > seqs = new ArrayList < FastaSequence > ( ) ; final BufferedReader infasta = new BufferedReader ( new InputStreamReader ( inStream , "UTF8" ) , 16000 ) ; final Pattern pattern = Pattern . compi... | Reads fasta sequences from inStream into the list of FastaSequence objects |
24,298 | public static void writeFasta ( final OutputStream os , final List < FastaSequence > sequences ) throws IOException { final OutputStreamWriter outWriter = new OutputStreamWriter ( os ) ; final BufferedWriter fasta_out = new BufferedWriter ( outWriter ) ; for ( final FastaSequence fs : sequences ) { fasta_out . write ( ... | Writes FastaSequence in the file each sequence will take one line only |
24,299 | @ SuppressWarnings ( "unused" ) private void reset ( ) { this . version = 0 ; this . versionSeen = false ; this . accession = null ; this . description = null ; this . identifier = null ; this . name = null ; this . comments . clear ( ) ; } | Sets the sequence info back to default values ie . in order to start constructing a new sequence from scratch . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.