text stringlengths 0 828 |
|---|
for peptide in proteinEntry.sharedPeptides: |
startPos, endPos = peptidedb[peptide].proteinPositions[proteinId] |
coverageMaskShared[startPos-1:endPos] = True |
setattr(proteinEntry, 'coverageMaskUnique', coverageMaskUnique) |
setattr(proteinEntry, 'coverageMaskShared', coverageMaskShared)" |
1986,"def fetch_keywords(codedata) : |
"""""" Fetch keywords by shaman.KeywordFetcher |
Get average probabilities of keyword and language |
"""""" |
# Read row in codedata and count keywords in codes with langauge |
tmp = {} |
language_counts = {} |
for index, (language, code) in enumerate(codedata) : |
if language not in shaman.SUPPORTING_LANGUAGES : |
continue |
if language not in tmp : |
tmp[language] = {} |
language_counts[language] = 0 |
language_counts[language] += 1 |
for keyword in shaman.KeywordFetcher.fetch( code ) : |
# if keyword exists in fetched data, add '1' to keyword data |
tmp[language][keyword] = tmp[language].get(keyword, 0) + 1 |
print('Fetch keyword %d/%d ' % (index, len(codedata)), end='\r') |
# Get dataset indexed by keyword |
ret = {} |
for language in tmp : |
for keyword, count in tmp[ language ].items() : |
if keyword not in ret : |
ret[ keyword ] = {} |
ret[ keyword ][ language ] = (count / language_counts[ language ]) # Probability |
print('Fetch keyword completed ') |
return ret" |
1987,"def match_patterns(codedata) : |
"""""" Match patterns by shaman.PatternMatcher |
Get average ratio of pattern and language |
"""""" |
ret = {} |
for index1, pattern in enumerate(shaman.PatternMatcher.PATTERNS) : |
print('Matching pattern %d ""%s""' % (index1+1, pattern)) |
matcher = shaman.PatternMatcher(pattern) |
tmp = {} |
for index2, (language, code) in enumerate(codedata) : |
if language not in shaman.SUPPORTING_LANGUAGES : |
continue |
if len(code) <= 20 or len(code) > 100000 : |
continue |
if language not in tmp : |
tmp[language] = [] |
ratio = matcher.getratio(code) |
tmp[language].append(ratio) |
print('Matching patterns %d/%d ' % (index2, len(codedata)), end='\r') |
ret[pattern] = {} |
for language, data in tmp.items() : |
ret[pattern][language] = sum(tmp[language]) / max(len(tmp[language]), 1) |
print('Matching patterns completed ') |
return ret" |
1988,"def facility(self, column=None, value=None, **kwargs): |
"""""" |
Check information related to Radiation facilities. |
>>> RADInfo().facility('state_code', 'CA') |
"""""" |
return self._resolve_call('RAD_FACILITY', column, value, **kwargs)" |
1989,"def facility_type(self, column=None, value=None, **kwargs): |
"""""" |
Basic identifying information for a RADInfo facility, including |
the improved facility information maintained by the Facility |
Registry System (FRS). |
>>> RADInfo().facility_type('cit_ref_code', '40CFR300') |
"""""" |
return self._resolve_call('RAD_FACILITY_TYPE', column, value, **kwargs)" |
1990,"def geo(self, column=None, value=None, **kwargs): |
"""""" |
Locate a facility through geographic location. |
>>> RADInfo().geo('geometric_type_code', '001') |
"""""" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.