_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
31
13.1k
language
stringclasses
1 value
meta_information
dict
q248300
FTPAccountAuthorizer.has_perm
train
def has_perm(self, username, perm, path=None): """check user permission """ account
python
{ "resource": "" }
q248301
FTPAccountAuthorizer.get_perms
train
def get_perms(self, username): """return user permissions
python
{ "resource": "" }
q248302
FTPAccountAuthorizer.impersonate_user
train
def impersonate_user(self, username, password): """delegate to personate_user method """
python
{ "resource": "" }
q248303
ColorHelper.hex_to_rgb
train
def hex_to_rgb(self, h): """Converts a valid hex color string to an RGB array."""
python
{ "resource": "" }
q248304
ColorHelper.cross_product
train
def cross_product(self, p1, p2): """Returns the
python
{ "resource": "" }
q248305
ColorHelper.get_distance_between_two_points
train
def get_distance_between_two_points(self, one, two): """Returns the distance between two XYPoints.""" dx = one.x - two.x
python
{ "resource": "" }
q248306
ColorHelper.get_xy_point_from_rgb
train
def get_xy_point_from_rgb(self, red_i, green_i, blue_i): """Returns an XYPoint object containing the closest available CIE 1931 x, y coordinates based on the RGB input values.""" red = red_i / 255.0 green = green_i / 255.0 blue = blue_i / 255.0 r = ((red + 0.055) / (1.0...
python
{ "resource": "" }
q248307
Converter.hex_to_xy
train
def hex_to_xy(self, h): """Converts hexadecimal colors represented as a String to approximate CIE
python
{ "resource": "" }
q248308
Converter.rgb_to_xy
train
def rgb_to_xy(self, red, green, blue): """Converts red, green and blue integer values to approximate CIE 1931
python
{ "resource": "" }
q248309
Converter.get_random_xy_color
train
def get_random_xy_color(self): """Returns the approximate CIE 1931 x,y coordinates represented by the supplied hexColor parameter, or of a random color if the parameter is not passed.""" r = self.color.random_rgb_value()
python
{ "resource": "" }
q248310
become_daemon
train
def become_daemon(*args, **kwargs): """become_daemon function wrapper In Django 1.9, 'become_daemon' is removed. It means compatibility. """ if django.VERSION >= (1, 9):
python
{ "resource": "" }
q248311
SpecCase.setUpClass
train
def setUpClass(cls): """Always overridden by the child cases, but let's put some real values in here to test with""" self.obsmode=None
python
{ "resource": "" }
q248312
GraphTable.validate
train
def validate(self): """ Simulataneously checks for loops and unreachable nodes """ msg = list() previously_seen = set() currently_seen = set([1]) problemset = set() while currently_seen: node = currently_seen.pop() if node in previously_see...
python
{ "resource": "" }
q248313
set_default_waveset
train
def set_default_waveset(minwave=500, maxwave=26000, num=10000, delta=None, log=True): """Set the default wavelength set, ``pysynphot.refs._default_waveset``. Parameters ---------- minwave, maxwave : float, optional The start (inclusive) and end (exclusive) points of the ...
python
{ "resource": "" }
q248314
_set_default_refdata
train
def _set_default_refdata(): """Default refdata set on import.""" global GRAPHTABLE, COMPTABLE, THERMTABLE, PRIMARY_AREA # Component tables are defined here. try: GRAPHTABLE = _refTable(os.path.join('mtab','*_tmg.fits')) COMPTABLE = _refTable(os.path.join('mtab','*_tmc.fits')) excep...
python
{ "resource": "" }
q248315
setref
train
def setref(graphtable=None, comptable=None, thermtable=None, area=None, waveset=None): """Set default graph and component tables, primary area, and wavelength set. This is similar to setting ``refdata`` in IRAF STSDAS SYNPHOT. If all parameters set to `None`, they are reverted to software de...
python
{ "resource": "" }
q248316
getref
train
def getref(): """Current default values for graph and component tables, primary area, and wavelength set. .. note:: Also see :func:`setref`. Returns ------- ans : dict Mapping of parameter names to their current values. """ ans=dict(graphtable=GRAPHTABLE,
python
{ "resource": "" }
q248317
read_kwfile
train
def read_kwfile(fname): """Syntax used as of r452 in commissioning tests""" d={} f=open(fname) for line in f: try: kvpair=re.findall("(.*):: (.*)=(.*)$",line)[0]
python
{ "resource": "" }
q248318
ObsBandpass
train
def ObsBandpass(obstring, graphtable=None, comptable=None, component_dict={}): """Generate a bandpass object from observation mode. If the bandpass consists of multiple throughput files (e.g., "acs,hrc,f555w"), then `ObsModeBandpass` is returned. Otherwise, if it consists of a single throughput file ...
python
{ "resource": "" }
q248319
ObsModeBandpass.thermback
train
def thermback(self): """Calculate thermal background count rate for ``self.obsmode``. Calculation uses :func:`~pysynphot.observationmode.ObservationMode.ThermalSpectrum` to extract thermal component source spectrum in ``photlam`` per square arcsec. Then this spectrum is ...
python
{ "resource": "" }
q248320
MergeWaveSets
train
def MergeWaveSets(waveset1, waveset2): """Return the union of the two wavelength sets. The union is computed using `numpy.union1d`, unless one or both of them is `None`. The merged result may sometimes contain numbers which are nearly equal but differ at levels as small as 1E-14. Having values thi...
python
{ "resource": "" }
q248321
trimSpectrum
train
def trimSpectrum(sp, minw, maxw): """Create a new spectrum with trimmed upper and lower ranges. Parameters ---------- sp : `SourceSpectrum` Spectrum to trim. minw, maxw : number Lower and upper limits (inclusive) for the wavelength set in the trimmed spectrum. Returns ...
python
{ "resource": "" }
q248322
Integrator.trapezoidIntegration
train
def trapezoidIntegration(self, x, y): """Perform trapezoid integration. Parameters ---------- x : array_like Wavelength set. y : array_like Integrand. For example, throughput or throughput multiplied by wavelength. Returns --...
python
{ "resource": "" }
q248323
Integrator.validate_wavetable
train
def validate_wavetable(self): """Enforce monotonic, ascending wavelength array with no zero or negative values. Raises ------ pysynphot.exceptions.DuplicateWavelength Wavelength array contains duplicate entries. pysynphot.exceptions.UnsortedWavelength ...
python
{ "resource": "" }
q248324
Integrator.validate_fluxtable
train
def validate_fluxtable(self): """Check for non-negative fluxes. If found, the negative flux values are set to zero, and a warning is printed to screen. This check is not done if flux unit is a magnitude because negative magnitude values are legal.
python
{ "resource": "" }
q248325
SourceSpectrum.addmag
train
def addmag(self, magval): """Add a scalar magnitude to existing flux values. .. math:: \\textnormal{flux}_{\\textnormal{new}} = 10^{-0.4 \\; \\textnormal{magval}} \\; \\textnormal{flux} Parameters ---------- magval : number Magnitude value. Ret...
python
{ "resource": "" }
q248326
SourceSpectrum.getArrays
train
def getArrays(self): """Return wavelength and flux arrays in user units. Returns ------- wave : array_like Wavelength array in ``self.waveunits``. flux : array_like Flux array in ``self.fluxunits``. When necessary, ``self.primary_area`` is us...
python
{ "resource": "" }
q248327
SourceSpectrum.validate_units
train
def validate_units(self): """Ensure that wavelenth and flux units belong to the correct classes. Raises ------ TypeError Wavelength unit is not `~pysynphot.units.WaveUnits` or flux unit is not `~pysynphot.units.FluxUnits`. """ if (not
python
{ "resource": "" }
q248328
SourceSpectrum.writefits
train
def writefits(self, filename, clobber=True, trimzero=True, binned=False, precision=None, hkeys=None): """Write the spectrum to a FITS table. Primary header in EXT 0. ``FILENAME``, ``ORIGIN``, and any extra keyword(s) from ``hkeys`` will also be added. Table header an...
python
{ "resource": "" }
q248329
SourceSpectrum.integrate
train
def integrate(self, fluxunits='photlam'): """Integrate the flux in given unit. Integration is done using :meth:`~Integrator.trapezoidIntegration` with ``x=wave`` and ``y=flux``, where flux has been convert to given unit first. .. math:: \\textnormal{result} = \\int...
python
{ "resource": "" }
q248330
SourceSpectrum.convert
train
def convert(self, targetunits): """Set new user unit, for either wavelength or flux. This effectively converts the spectrum wavelength or flux to given unit. Note that actual data are always kept in internal units (Angstrom and ``photlam``), and only converted
python
{ "resource": "" }
q248331
SourceSpectrum.setMagnitude
train
def setMagnitude(self, band, value): """Makes the magnitude of the source in the band equal to value. band is a SpectralElement. This method is marked for deletion once the .renorm method is well tested. Object returned is a CompositeSourceSpectrum. .. warning:: DO NOT ...
python
{ "resource": "" }
q248332
CompositeSourceSpectrum.tabulate
train
def tabulate(self): """Return a simplified version of the spectrum. Composite spectrum can be overly complicated when it has too many components and sub-components. This method copies the following into a simple (tabulated) source spectrum: * Name * Wavelength array and...
python
{ "resource": "" }
q248333
TabularSourceSpectrum._readASCII
train
def _readASCII(self, filename): """ASCII files have no headers. Following synphot, this routine will assume the first column is wavelength in Angstroms, and the second column is flux in Flam. """ self.waveunits = units.Units('angstrom') self.fluxunits = units.Units('flam...
python
{ "resource": "" }
q248334
FlatSpectrum.redshift
train
def redshift(self, z): """Apply redshift to the flat spectrum. Unlike :meth:`SourceSpectrum.redshift`, the redshifted spectrum remains an analytic flat source. Parameters
python
{ "resource": "" }
q248335
SpectralElement.validate_units
train
def validate_units(self): """Ensure that wavelenth unit belongs to the correct class. There is no check for throughput because it is unitless. Raises ------ TypeError Wavelength unit is not `~pysynphot.units.WaveUnits`.
python
{ "resource": "" }
q248336
SpectralElement.integrate
train
def integrate(self, wave=None): """Integrate the throughput over the specified wavelength set. If no wavelength set is specified, the built-in one is used. Integration is done using :meth:`~Integrator.trapezoidIntegration` with ``x=wave`` and ``y=throughput``.
python
{ "resource": "" }
q248337
SpectralElement.convert
train
def convert(self, targetunits): """Set new user unit, for wavelength only. This effectively converts the spectrum wavelength to given unit. Note that actual data are always kept in internal unit (Angstrom), and only converted to user unit by :meth:`GetWaveSet` during actual comp...
python
{ "resource": "" }
q248338
SpectralElement.sample
train
def sample(self, wave): """Sample the spectrum. This uses :meth:`resample` to do the actual computation. Parameters ---------- wave : number or array_like Wavelength set for sampling, given in user unit. Returns
python
{ "resource": "" }
q248339
UniformTransmission.writefits
train
def writefits(self, *args, **kwargs): """Write to file using default waveset.""" old_wave = self.wave
python
{ "resource": "" }
q248340
TabularSpectralElement.ToInternal
train
def ToInternal(self): """Convert wavelengths to the internal representation of angstroms. For internal use only.""" self.validate_units() savewunits = self.waveunits
python
{ "resource": "" }
q248341
Box.sample
train
def sample(self, wavelength): """Input wavelengths assumed to be in user unit."""
python
{ "resource": "" }
q248342
ObservationMode.Throughput
train
def Throughput(self): """Combined throughput from multiplying all the components together. Returns ------- throughput : `~pysynphot.spectrum.TabularSpectralElement` or `None` Combined throughput. """ try: throughput = spectrum.TabularSpectralElem...
python
{ "resource": "" }
q248343
ObservationMode.ThermalSpectrum
train
def ThermalSpectrum(self): """Calculate thermal spectrum. Returns ------- sp : `~pysynphot.spectrum.CompositeSourceSpectrum` Thermal spectrum in ``photlam``. Raises ------ IndexError Calculation failed. """ try: ...
python
{ "resource": "" }
q248344
_ThermalObservationMode._multiplyThroughputs
train
def _multiplyThroughputs(self): ''' Overrides base class in order to deal with opaque components. ''' index = 0 for component in self.components: if component.throughput != None:
python
{ "resource": "" }
q248345
reverse
train
def reverse(d): """Return a reverse lookup dictionary for the input dictionary""" r={}
python
{ "resource": "" }
q248346
print_red_laws
train
def print_red_laws(): """Print available extinction laws to screen. Available extinction laws are extracted from ``pysynphot.locations.EXTDIR``. The printed names may be used with :func:`Extinction` to retrieve available reddening laws. Examples -------- >>> S.reddening.print_red_laws() ...
python
{ "resource": "" }
q248347
Extinction
train
def Extinction(extval,name=None): """Generate extinction curve to be used with spectra. By default, :meth:`~CustomRedLaw.reddening` is used to generate the extinction curve. If a deprecated reddening law is given, then `~pysynphot.extinction.DeprecatedExtinction` is used instead. .. note:: ...
python
{ "resource": "" }
q248348
ExtinctionSpectralElement._getWaveProp
train
def _getWaveProp(self): """Return wavelength in user units.""" wave
python
{ "resource": "" }
q248349
CustomRedLaw.reddening
train
def reddening(self,extval): """Compute the reddening for the given extinction. .. math:: A(V) = R(V) \\; \\times \\; E(B-V) \\textnormal{THRU} = 10^{-0.4 \\; A(V)} .. note:: ``self.litref`` is passed into ``ans.citation``. Parameters ----...
python
{ "resource": "" }
q248350
GraphTable.GetNextNode
train
def GetNextNode(self, modes, innode): """GetNextNode returns the outnode that matches an element from the modes list, starting at the given innode. This method isnt actually used, its just a helper method for debugging purposes. """ nodes = N.where(self.innodes == innode...
python
{ "resource": "" }
q248351
GraphTable.GetComponentsFromGT
train
def GetComponentsFromGT(self, modes, innode): """Obtain components from graph table for the given observation mode keywords and starting node. .. note:: This prints extra information to screen if ``pysynphot.tables.DEBUG`` is set to `True`. Parameters -...
python
{ "resource": "" }
q248352
fincre
train
def fincre(oldname): """Increment the synphot version number from a filename""" x=re.search('_(?P<version>[0-9][0-9][0-9])_syn',oldname) version=x.group('version')
python
{ "resource": "" }
q248353
calcspecCase.run_crbox
train
def run_crbox(self,spstring,form,output="",wavecat="INDEF", lowave=0,hiwave=30000): """Calcspec has a bug. We will use countrate instead, and force it to use a box function of uniform transmission as the obsmode.""" range=hiwave-lowave midwave=range/2.0 iraf.co...
python
{ "resource": "" }
q248354
validate_overlap
train
def validate_overlap(comp1, comp2, force): """Validate the overlap between the wavelength sets of the two given components. Parameters ---------- comp1, comp2 : `~pysynphot.spectrum.SourceSpectrum` or `~pysynphot.spectrum.SpectralElement` Source spectrum and bandpass of an observation. ...
python
{ "resource": "" }
q248355
Observation.validate_overlap
train
def validate_overlap(self,force): """Validate that spectrum and bandpass overlap. Warnings are stored in ``self.warnings``. Parameters ---------- force : {'extrap', 'taper', `None`} If `None`, it is required that the spectrum and bandpass fully
python
{ "resource": "" }
q248356
Observation.initbinset
train
def initbinset(self,binset=None): """Set ``self.binwave``. By default, wavelength values for binning are inherited from bandpass. If the bandpass has no binning information, then source spectrum wavelengths are used. However, if user provides values, then those are used without ...
python
{ "resource": "" }
q248357
Observation.initbinflux
train
def initbinflux(self): """Calculate binned flux and edges. Flux is computed by integrating the spectrum on the specified binned wavelength set, using information from the natural wavelength set. Native wave/flux arrays should be considered samples of a continuous functi...
python
{ "resource": "" }
q248358
Observation.as_spectrum
train
def as_spectrum(self, binned=True): """Reduce the observation to a simple spectrum object. An observation is a complex object with some restrictions on its capabilities. At times, it would be useful to work with the simulated observation as a simple object that is easier to mani...
python
{ "resource": "" }
q248359
irafconvert
train
def irafconvert(iraffilename): """Convert the IRAF file name to its Unix equivalent. Input can be in ``directory$file`` or ``$directory/file`` format. If ``'$'`` is not found in the input string, it is returned as-is. Parameters ---------- iraffilename : str Filename in IRAF format. ...
python
{ "resource": "" }
q248360
get_data_filename
train
def get_data_filename(filename): """Map filename to its actual path. Parameters ---------- filename : str Filename to search. Returns ------- path : str Full path to the file in data directory. """ global _data_map if _data_map is None: _data_map = {} ...
python
{ "resource": "" }
q248361
StdRenorm
train
def StdRenorm(spectrum, band, RNval, RNunitstring, force=False): """This is used by `~pysynphot.spectrum.SourceSpectrum` for renormalization. Parameters ---------- spectrum : `~pysynphot.spectrum.SourceSpectrum` Spectrum to renormalize. band, RNval, RNunitstring, force See :met...
python
{ "resource": "" }
q248362
setdirs
train
def setdirs(outfiles): """Create the directories if need be""" for k in outfiles: fname=outfiles[k] dname=
python
{ "resource": "" }
q248363
bb_photlam_arcsec
train
def bb_photlam_arcsec(wave, temperature): """Evaluate Planck's law in ``photlam`` per square arcsec. .. note:: Uses :func:`llam_SI` for calculation, and then converts SI units back to CGS. Parameters ---------- wave : array_like Wavelength values in Angstrom. temperat...
python
{ "resource": "" }
q248364
Units
train
def Units(uname): """Generate a unit object. Parameters ---------- uname : str Wavelength or flux unit name. Returns ------- unit : `BaseUnit` or `None` Unit object. `None` means unitless. Raises ------ ValueError Unknown unit name. """ if isin...
python
{ "resource": "" }
q248365
ismatch
train
def ismatch(a,b): """Method to allow smart comparisons between classes, instances, and string representations of units and give the right answer. For internal use only.""" #Try the easy case if a == b: return True else: #Try isinstance in both orders try: if i...
python
{ "resource": "" }
q248366
Photlam.ToABMag
train
def ToABMag(self, wave, flux, **kwargs): """Convert to ``abmag``. .. math:: \\textnormal{AB}_{\\nu} = -2.5 \\; \\log(h \\lambda \\; \\textnormal{photlam}) - 48.6 where :math:`h` is as defined in :ref:`pysynphot-constants`. Parameters ---------- wave, flux ...
python
{ "resource": "" }
q248367
Photlam.ToSTMag
train
def ToSTMag(self, wave, flux, **kwargs): """Convert to ``stmag``. .. math:: \\textnormal{ST}_{\\lambda} = -2.5 \\; \\log(\\frac{hc}{\\lambda} \\; \\textnormal{photlam}) - 21.1 where :math:`h` and :math:`c` are as defined in :ref:`pysynphot-constants`. Parameters ...
python
{ "resource": "" }
q248368
Photlam.ToOBMag
train
def ToOBMag(self, wave, flux, area=None): """Convert to ``obmag``. .. math:: \\textnormal{obmag} = -2.5 \\; \\log(\\delta \\lambda \\; \\times \\; \\textnormal{area} \\; \\times \\; \\textnormal{photlam}) where :math:`\\delta \\lambda` represent bin widths derived from :f...
python
{ "resource": "" }
q248369
Photlam.ToVegaMag
train
def ToVegaMag(self, wave, flux, **kwargs): """Convert to ``vegamag``. .. math:: \\textnormal{vegamag} = -2.5 \\; \\log(\\frac{\\textnormal{photlam}}{f_{\\textnormal{Vega}}}) where :math:`f_{\\textnormal{Vega}}` is the flux of :ref:`pysynphot-vega-spec` resampled at given w...
python
{ "resource": "" }
q248370
GraftMPackage.acquire
train
def acquire(graftm_package_path): '''Acquire a new graftm Package Parameters ---------- graftm_output_path: str path to base directory of graftm ''' contents_hash = json.load( open( ...
python
{ "resource": "" }
q248371
GraftMPackage.check_required_keys
train
def check_required_keys(self, required_keys): '''raise InsufficientGraftMPackageException if this package does not conform to the standard of the given package''' h = self._contents_hash for key in required_keys:
python
{ "resource": "" }
q248372
GraftMPackageVersion2.compile
train
def compile(output_package_path, refpkg_path, hmm_path, diamond_database_file, max_range, trusted_cutoff=False, search_hmm_files=None): '''Create a new GraftM package with the given inputs. Any files specified as parameters are copied into the final package so can be removed aft...
python
{ "resource": "" }
q248373
GraftMPackageVersion3.create_diamond_db
train
def create_diamond_db(self): '''Create a diamond database from the unaligned sequences in this package. Returns ------- path to the created diamond db e.g. 'my_sequences.dmnd' ''' base = self.unaligned_sequence_database_path() cmd = "diamond makedb --in '%s' -d '...
python
{ "resource": "" }
q248374
GraftMPackageVersion3.graftm_package_is_protein
train
def graftm_package_is_protein(graftm_package): '''Return true if this package is an Amino Acid alignment package, otherwise False i.e. it is a nucleotide package. In general it is best to use 'is_protein_package' instead. ''' found = None with open(graftm_package.alignme...
python
{ "resource": "" }
q248375
GraftMPackageVersion3.is_protein_package
train
def is_protein_package(self): '''Return true if this package is an Amino Acid alignment package, otherwise False i.e. it is a nucleotide package. Cache the result for speed. ''' if not hasattr(self, '_is_protein_package'):
python
{ "resource": "" }
q248376
UnpackRawReads.basename
train
def basename(self): '''Return the name of the file with the '.fasta' or 'fq.gz' etc removed'''
python
{ "resource": "" }
q248377
DendropyTreeCleaner.match_alignment_and_tree_sequence_ids
train
def match_alignment_and_tree_sequence_ids(self, sequence_names, tree): '''Check to make sure that the sequences specified in the alignment and the tree are the same, otherwise raise an Exception detailing the problem for the user to fix Parameters ---------- sequence_nam...
python
{ "resource": "" }
q248378
DendropyTreeCleaner.remove_sequences
train
def remove_sequences(self, tree, sequence_names): '''Remove sequences with in the given sequence_names array from the tree in place. Assumes the sequences are found in the tree, and that they are all unique.
python
{ "resource": "" }
q248379
SequenceSearcher._hmmalign
train
def _hmmalign(self, input_path, directions, pipeline, forward_reads_output_path, reverse_reads_output_path): ''' Align reads to the aln_hmm. Receives unaligned sequences and aligns them. Parameters ---------- input_path : str Filename of una...
python
{ "resource": "" }
q248380
SequenceSearcher.hmmalign_sequences
train
def hmmalign_sequences(self, hmm, sequences, output_file): '''Run hmmalign and convert output to aligned fasta format Parameters ---------- hmm: str path to hmm file sequences: str path to file of sequences to be aligned output_file: str ...
python
{ "resource": "" }
q248381
SequenceSearcher.hmmsearch
train
def hmmsearch(self, output_path, input_path, unpack, seq_type, threads, cutoff, orfm): ''' hmmsearch - Search raw reads for hits using search_hmm list Parameters ---------- output_path : str path to output domtblout table input_path : str path to ...
python
{ "resource": "" }
q248382
SequenceSearcher.merge_forev_aln
train
def merge_forev_aln(self, forward_aln_list, reverse_aln_list, outputs): ''' merge_forev_aln - Merges forward and reverse alignments for a given run Parameters ---------- aln_list : array List of the forward and reverse alignments for each of the runs give...
python
{ "resource": "" }
q248383
SequenceSearcher.nhmmer
train
def nhmmer(self, output_path, unpack, threads, evalue): ''' nhmmer - Search input path using nhmmer Parameters ---------- output_path : str A string containing the path to the input sequences unpack : obj UnpackRawReads object, returns string comm...
python
{ "resource": "" }
q248384
SequenceSearcher._check_euk_contamination
train
def _check_euk_contamination(self, hmm_hit_tables): ''' check_euk_contamination - Check output HMM tables hits reads that hit the 18S HMM with a higher bit score. Parameters ---------- hmm_hit_tables : array Array of paths to the out...
python
{ "resource": "" }
q248385
SequenceSearcher._extract_multiple_hits
train
def _extract_multiple_hits(self, hits, reads_path, output_path): ''' splits out regions of a read that hit the HMM. For example when two of same gene are identified within the same contig, The regions mapping to the HMM will be split out and written out to a new file as a new record. ...
python
{ "resource": "" }
q248386
SequenceSearcher.alignment_correcter
train
def alignment_correcter(self, alignment_file_list, output_file_name, filter_minimum=None): ''' Remove lower case insertions in alignment outputs from HMM align. Give a list of alignments, and an output file name, and each alignment will be corrected, and writt...
python
{ "resource": "" }
q248387
SequenceSearcher._extract_orfs
train
def _extract_orfs(self, input_path, orfm, hit_readnames, output_path, search_method, sequence_frame_info_list=None): ''' Call ORFs on a file with nucleotide sequences and extract the proteins whose name is in `hit_readnames`. Parameters ---------- input_path : str ...
python
{ "resource": "" }
q248388
SequenceSearcher.aa_db_search
train
def aa_db_search(self, files, base, unpack, search_method, maximum_range, threads, evalue, min_orf_length, restrict_read_length, diamond_database): ''' Amino acid database search pipeline - pipeline where reads are searched as amino acids, and hits are i...
python
{ "resource": "" }
q248389
SequenceSearcher.nt_db_search
train
def nt_db_search(self, files, base, unpack, euk_check, search_method, maximum_range, threads, evalue): ''' Nucleotide database search pipeline - pipeline where reads are searched as nucleotides, and hits are identified using nhmmer searches Parameters ------...
python
{ "resource": "" }
q248390
SequenceSearcher.align
train
def align(self, input_path, output_path, directions, pipeline, filter_minimum): '''align - Takes input path to fasta of unaligned reads, aligns them to a HMM, and returns the aligned reads in the output path Parameters ---------- input_path : str output_pa...
python
{ "resource": "" }
q248391
Rerooter.reroot_by_tree
train
def reroot_by_tree(self, old_tree, new_tree): '''reroot the new tree so that it matches the old tree's root, if possible. If more than one rerooting is possible, root at the longest internal branch that is consistent with the root of the old_tree. Assumes that the tree is binary. Both ...
python
{ "resource": "" }
q248392
Run._assign_taxonomy_with_diamond
train
def _assign_taxonomy_with_diamond(self, base_list, db_search_results, graftm_package, graftm_files): '''Run diamond to assign taxonomy Parameters ---------- base_list: list of str list of sequence block names db_search_results: l...
python
{ "resource": "" }
q248393
Update._concatenate_file
train
def _concatenate_file(self, file_list, output): ''' Call unix "cat" to concatenate a list of files Parameters ---------- file_list: list List of strings, each leading to a file. These files are the ones to
python
{ "resource": "" }
q248394
GreenGenesTaxonomy.write
train
def write(self, output_io): '''Write a taxonomy to an open stream out in GG format. Code calling this function must open and close the io object.'''
python
{ "resource": "" }
q248395
Decorator._reroot
train
def _reroot(self): '''Run the re-rooting algorithm in the Rerooter class.''' rerooter = Rerooter()
python
{ "resource": "" }
q248396
HouseKeeping.file_basename
train
def file_basename(self, file): ''' Strips the path and last extension from the file variable. If the extension is found to be valid, the basename will be returned. Otherwise an error will be raise and graftM will exit ''' valid_extensions = set(".tree", ...
python
{ "resource": "" }
q248397
HouseKeeping.set_euk_hmm
train
def set_euk_hmm(self, args): 'Set the hmm used by graftM to cross check for euks.' if hasattr(args, 'euk_hmm_file'): pass elif not hasattr(args, 'euk_hmm_file'): # set to path based on the location of bin/graftM, which has # a more stable relative path to the ...
python
{ "resource": "" }
q248398
HouseKeeping.get_maximum_range
train
def get_maximum_range(self, hmm): ''' If no maximum range has been specified, and if using a hmm search, a maximum range can be determined by using the length of the HMM Parameters
python
{ "resource": "" }
q248399
Pplacer.place
train
def place(self, reverse_pipe, seqs_list, resolve_placements, files, args, slash_endings, tax_descr, clusterer): ''' placement - This is the placement pipeline in GraftM, in aligned reads are placed into phylogenetic trees, and the results interpreted. ...
python
{ "resource": "" }