query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Delete a project files.
def delete_project_files(self, project, logStat): from corrdb.common.models import FileModel from corrdb.common.models import EnvironmentModel for _file in project.resources: file_ = FileModel.objects.with_id(_file) if file_: result = self.storage_delete_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_project(proj_id):\n project_obj = Project.objects.get(id=proj_id)\n print('Deleting project the fastq files within the project: ', project_obj.description)\n\n description = project_obj.description.replace(' ', '') # remove any space in the project name\n project_dir = 'documents/%s/%s' % (...
[ "0.7671678", "0.70789576", "0.69476116", "0.67798454", "0.66957814", "0.6679533", "0.6669261", "0.663331", "0.6531018", "0.6503622", "0.6503622", "0.64738876", "0.6457917", "0.64377785", "0.6412456", "0.6380504", "0.6365763", "0.63568527", "0.635452", "0.6349144", "0.634238",...
0.74385405
1
Delete a record files.
def delete_record_files(self, record, logStat): from corrdb.common.models import FileModel final_result = True for _file_id in record.resources: _file = FileModel.objects.with_id(_file_id) result = self.delete_record_file(_file, logStat) if not result: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_records(self, records_to_delete):\n for record in records_to_delete:\n self.records.remove(record)\n self._store_writer.remove_img_file(record)\n\n self._process_change()", "def delete_record(records):\n delete_record()", "def delete(self, filename):\n p...
[ "0.75914454", "0.7471837", "0.73076427", "0.7286397", "0.6935407", "0.68690795", "0.67846966", "0.6765541", "0.6712611", "0.6703749", "0.66534185", "0.6648763", "0.6578517", "0.656606", "0.6554084", "0.65478927", "0.6511074", "0.64954126", "0.6470087", "0.6469611", "0.6414448...
0.77628917
0
Delete a record file and log the stats.
def delete_record_file(self, record_file, logStat): result = self.storage_delete_file(record_file.group, record_file.storage) if result: logStat(deleted=True, file_obj=record_file) record_file.delete() return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_file(fileName):\n os.remove(fileName)\n print (\"Deleteing file: \" + str(fileName))\n write_log()\n read_log()", "def delete(self, filename):\n pass", "def delete_log():\n log_path = Path.cwd() / \"premise.log\"\n if log_path.exists():\n log_path.unli...
[ "0.6743752", "0.6579642", "0.65737575", "0.6460211", "0.64425284", "0.6401115", "0.6390069", "0.63400424", "0.63385975", "0.6327259", "0.6298369", "0.6264551", "0.6233331", "0.6219438", "0.620855", "0.6170005", "0.61598647", "0.61536807", "0.61153316", "0.6106858", "0.6105311...
0.81148934
0
Retrieve a externaly hosted file.
def web_get_file(self, url): try: print(url) response = requests.get(url, verify=False) file_buffer = BytesIO(response.content) file_buffer.seek(0) return file_buffer except: print(traceback.print_exc()) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file(self, sys_id):\n url = \"{}/file\".format(self._target(sys_id))\n r = self._client.session.get(url, stream=True)\n return r", "def get_file(URI):\n return file_fabric.get_class(URI).get_content(URI)", "def _fs_get_file(url, working_dir):\n if not os.path.isabs(url) a...
[ "0.7363333", "0.71599615", "0.7076054", "0.70494545", "0.70425373", "0.6997317", "0.69079727", "0.68707514", "0.68504196", "0.67665625", "0.6739661", "0.6723161", "0.6715714", "0.6701585", "0.6683252", "0.6590083", "0.6564484", "0.65569955", "0.65451306", "0.65384126", "0.648...
0.7258937
1
Bundle a project's environment.
def prepare_env(self, project=None, env=None): if project == None or env == None: return [None, ''] else: memory_file = BytesIO() with zipfile.ZipFile(memory_file, 'w') as zf: if env.bundle != None and env.bundle.storage != '': try:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env(config, args):\n print config.template(\"scripts/env.sh\", project=args.project)", "def venv(session):\n # Install dependencies.\n session.install(\"--upgrade\", \"pip\", \"setuptools\")\n session.install(\"-r\", \"requirements-dev.txt\")\n session.install(\"-e\", \".\")\n\n # Customize...
[ "0.6130687", "0.598805", "0.5796788", "0.57524836", "0.5727751", "0.572663", "0.57033294", "0.564921", "0.5631391", "0.56252474", "0.560973", "0.55973923", "0.5581485", "0.55788237", "0.55742204", "0.556539", "0.55550957", "0.5539426", "0.5535784", "0.55265415", "0.5499274", ...
0.60943496
1
Bundle an entire project
def prepare_project(self, project=None): if project == None: return [None, ''] else: memory_file = BytesIO() with zipfile.ZipFile(memory_file, 'w') as zf: project_dict = project.compress() comments = project_dict['comments'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bundle(self, app):\r\n assert(isinstance(app, BundleCreate.App))\r\n\r\n bundledir = os.path.join(self.outdir, '%s-bundle' % app.basename)\r\n self.context.log.info('creating %s' % os.path.relpath(bundledir, get_buildroot()))\r\n\r\n safe_mkdir(bundledir, clean=True)\r\n\r\n classpath = OrderedS...
[ "0.7010875", "0.6967056", "0.6888113", "0.6599871", "0.6222634", "0.605871", "0.6051443", "0.60132384", "0.60054195", "0.59053683", "0.59019786", "0.58943903", "0.58280486", "0.58280486", "0.58280486", "0.58267844", "0.57887137", "0.57834375", "0.57525575", "0.5728965", "0.57...
0.0
-1
Obtain ORI, AGENCY, CGOVTYPE, FIPS_STATE, FIPS_PLACE from final main(9001) file
def get_final_main_cgovtype_ori_agency(file_path): final_main_df = pd.read_csv(file_path) final_main_fips_ori_agency = final_main_df[['ORI', 'AGENCY', 'CGOVTYPE', 'FIPS_STATE', 'FIPS_PLACE']] """ 1. Obtain only unique records from the final main file - key: fips place + fips state """ final_mai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ogip_dictionary_arf():\n \"\"\"\n this function returns the required and optional keywords and columns\n as defined by OGIP 92-002 and 92-002a\n \"\"\"\n global status\n global REPORT\n\n \"\"\"\n FOR the ARF file:\n \"\"\"\n \"\"\"\n Define REQUIRED Keywords for SPECRESP EXTE...
[ "0.60176206", "0.56555265", "0.5474328", "0.5407819", "0.5401295", "0.5373873", "0.5334079", "0.5289622", "0.52885354", "0.5262731", "0.5220959", "0.5170142", "0.51691955", "0.5163392", "0.5162932", "0.5147522", "0.5127302", "0.5127064", "0.51110655", "0.5105965", "0.5087524"...
0.5832184
1
Merge CGOVTYPE, ORI, AGENCY from final main file into census files based on state and place fips.
def get_glevel_ori_agency(county_cens_file, crime_df, filename, cens_year, city_cens_file=False): """ 1. Append cities census file to counties census file """ national_census_df = pd.read_csv(county_cens_file) """ Checking for city census file coz we need to first append city census file t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_final_main_cgovtype_ori_agency(file_path):\n final_main_df = pd.read_csv(file_path)\n final_main_fips_ori_agency = final_main_df[['ORI', 'AGENCY', 'CGOVTYPE', 'FIPS_STATE', 'FIPS_PLACE']]\n\n \"\"\"\n 1. Obtain only unique records from the final main file - key: fips place + fips state\n \"\...
[ "0.63951296", "0.5647709", "0.5632972", "0.5529909", "0.5512112", "0.5358087", "0.53524876", "0.534505", "0.53141177", "0.53104985", "0.5308745", "0.52762294", "0.5263449", "0.5253142", "0.52261686", "0.522328", "0.51910317", "0.51679087", "0.5163909", "0.5161484", "0.5154538...
0.629315
1
Return a dictionary of a location's properties.
def to_dict(self): return { 'location_id': self.location_id, 'location_name': self.location_name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_properties():", "def get_locations():\n return STATUS['locations']", "def _get_location_details(self, location):\n resp = requests.get(\n self.base_url,\n params = {\n 'address': ''.join(location.split(' ')),\n 'key': GOOGLE_API_KEY,\n ...
[ "0.66905564", "0.6581534", "0.65401554", "0.65313935", "0.65221065", "0.650296", "0.6466247", "0.6466247", "0.6427804", "0.6427804", "0.6396865", "0.6388714", "0.637269", "0.63603663", "0.6325594", "0.631466", "0.62228143", "0.62096256", "0.6171209", "0.6171209", "0.6163851",...
0.7027157
0
Get all location information.
def get_all_locations(): with mysql.db_session(read_only=True) as session: locations = session.query(Location) if not locations: return response.create_not_found_response(message='No data found.') locations_list = [location.to_dict() for location in locations.all()] ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_locations(self):", "def get_locations():\n return STATUS['locations']", "def _get_locations(self):\n data = self._get(\"/locations\")\n if \"locations\" not in data:\n _LOGGER.error(\"Did not find locations\")\n raise AirthingsError(data)\n return [Airt...
[ "0.8264251", "0.7730791", "0.7646061", "0.7641998", "0.76257235", "0.7396406", "0.72686344", "0.72615665", "0.72615665", "0.72615665", "0.72615665", "0.72615665", "0.72615665", "0.72615665", "0.72378725", "0.72178155", "0.7145518", "0.71387655", "0.7076445", "0.70287126", "0....
0.6737754
32
Aggregate columns programmatically by key.
def aggregate(self, **named_exprs): agg_base = self._parent.columns[0] # FIXME hack named_exprs = {k: to_expr(v) for k, v in named_exprs.items()} strs = [] base, cleanup = self._parent._process_joins(*(tuple(v for _, v in self._groups) + tuple(named_exprs.values()))) for k, v ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _aggregate(self, method, column, keys=None, **kwds_filter):\n fn = lambda src: getattr(src, method)(column, keys, **kwds_filter)\n results = (fn(source) for source in self._sources) # Perform aggregation.\n\n if not keys:\n return sum(results) # <- EXIT!\n\n total = def...
[ "0.624569", "0.6182713", "0.5959669", "0.585134", "0.58205134", "0.58175886", "0.5809809", "0.57893384", "0.5758293", "0.57507086", "0.5689084", "0.565568", "0.55807096", "0.5495027", "0.5494613", "0.5443911", "0.54225457", "0.542183", "0.52948076", "0.52925116", "0.5273306",...
0.536521
18
Change which columns are keys. Examples
def key_by(self, *keys): return Table(self._hc, self._jkt.keyBy(list(keys)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_columns(self):\n return [str(column) for id, column in self._columns.iteritems() if column.is_key]", "def customize_dict_keys(x, col, keys):\n new_keys = [key + '_' + col for key in keys]\n new_dict = dict(zip(new_keys, list(x.values())))\n return new_dict", "def col_attr_keys(cls):\n ...
[ "0.66324806", "0.65320694", "0.6021394", "0.59947705", "0.5966303", "0.5946692", "0.5938247", "0.59318346", "0.58745146", "0.58167243", "0.5744298", "0.57131296", "0.56735927", "0.5670225", "0.55808014", "0.5543086", "0.5528298", "0.54567325", "0.54461557", "0.5443332", "0.54...
0.56348825
14
Add new columns. Examples
def annotate(self, **named_exprs): # ordered to support nested joins unique_join_ids = OrderedDict() named_exprs = {k: to_expr(v) for k, v in named_exprs.items()} exprs = [] base, cleanup = self._process_joins(*named_exprs.values()) for k, v in named_exprs.items(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_feature_columns(self, feature_columns: typing.List[str]):\n self.feature_columns += feature_columns", "def AddColumns(sqlite_file, table_name):\r\n columns = ['cf_direct_parent','cf_kingdom','cf_superclass',\\\r\n 'cf_class','cf_subclass','cf_intermediate_0','cf_intermediate_1',\\\r\n 'cf...
[ "0.7552649", "0.7306828", "0.73056036", "0.7273557", "0.7235556", "0.71608555", "0.698906", "0.6910378", "0.6893764", "0.6882202", "0.68811065", "0.6832667", "0.67998314", "0.6790869", "0.67523205", "0.6719591", "0.67119694", "0.6705597", "0.6704973", "0.66964674", "0.6627902...
0.0
-1
Select a subset of columns. Examples
def select(self, *exprs, **named_exprs): exprs = tuple(self[e] if not isinstance(e, Expression) else e for e in exprs) named_exprs = {k: to_expr(v) for k, v in named_exprs.items()} strs = [] all_exprs = [] base, cleanup = self._process_joins(*(exprs + tuple(named_exprs.values())...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_columns(data, columns):\n return data.loc[:, columns]", "def select_columns(variables):\n return relevant_raw_data_df[variables]", "def select(self, *columns):\n if not columns:\n columns = ['*']\n\n self.columns = columns\n\n return self", "def _select_column...
[ "0.7668508", "0.71690387", "0.68801653", "0.68578726", "0.67978144", "0.66762745", "0.66732544", "0.66654706", "0.6469226", "0.6454181", "0.6432055", "0.63426006", "0.6323973", "0.6304232", "0.6296819", "0.62824005", "0.6269139", "0.6262358", "0.60979587", "0.6059077", "0.605...
0.0
-1
Drop fields from the table.
def drop(self, *exprs): all_field_exprs = {e: k for k, e in self._fields.items()} fields_to_drop = set() for e in exprs: if isinstance(e, Expression): if e in all_field_exprs: fields_to_drop.add(all_field_exprs[e]) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drop_fields(key):\n return scom.drop_fields(key)", "def remove_all_fields(self):\n self.fields = None", "def drop(self, name: str):\n del self._fields[name]", "def drop(self, fields, inplace=True):\n if inplace:\n obj = self\n else:\n obj = copy.deepco...
[ "0.7174094", "0.7046795", "0.68389964", "0.68167126", "0.6694292", "0.6497905", "0.6424772", "0.6414913", "0.64067745", "0.6370231", "0.63153905", "0.62897575", "0.6282599", "0.62677306", "0.6245792", "0.6228459", "0.6182475", "0.6177673", "0.61292", "0.6106664", "0.61036354"...
0.694065
2
Export to a TSV file.
def export(self, output, types_file=None, header=True, parallel=False): self._jkt.export(output, types_file, header, parallel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_tsv(self):\n outputfile = tkinter.filedialog.asksaveasfilename(\n defaultextension=\".tsv\",\n filetypes=((\"tab seperated values\", \"*.tsv\"),\n (\"All Files\", \"*.*\")))\n if outputfile:\n tabledata = self.tabs.window.aistracker.cr...
[ "0.87178445", "0.7538085", "0.7378153", "0.7270923", "0.7220619", "0.72028023", "0.68534136", "0.6826255", "0.67841077", "0.6765043", "0.6752011", "0.67405343", "0.66576815", "0.6615525", "0.6598396", "0.65755093", "0.6547236", "0.6541773", "0.6509289", "0.647135", "0.6422460...
0.0
-1
Hail2's version of the old 'query'
def aggregate(self, **named_exprs): agg_base = self.columns[0] # FIXME hack named_exprs = {k: to_expr(v) for k, v in named_exprs.items()} strs = [] base, _ = self._process_joins(*named_exprs.values()) for k, v in named_exprs.items(): analyze(v, self._global_indices,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(self, query):", "def make_query(self):", "def query3() :", "def _make_query(self):\r\n raise NotImplementedError()", "def query(self):", "def _run_query(self):", "def query(output, query):\n gqlapi = gql.get_api()\n print_output(output, gqlapi.query(query))", "def query(self):\...
[ "0.7716159", "0.7569825", "0.7308509", "0.7136565", "0.70971316", "0.70738155", "0.69584674", "0.6846496", "0.68333334", "0.6792067", "0.6789555", "0.674204", "0.65124893", "0.6494762", "0.643916", "0.6408027", "0.6301426", "0.6290342", "0.626811", "0.626811", "0.626811", "...
0.0
-1
Write as KT file. Examples >>> table1.write('output/table1.kt')
def write(self, output, overwrite=False): self._jkt.write(output, overwrite)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(filename):\n print(uc.write(filename))", "def write_table(table, file_path):\n\n\twith open(file_path, 'w') as file:\n\t\tfile.write(table)", "def write(self, filename, **kwargs):\n self.to_table().write(filename, format='fits', **kwargs)", "def write_to_file(self, filename):\n sel...
[ "0.6571129", "0.64942557", "0.6472391", "0.6345532", "0.6214351", "0.619263", "0.61315256", "0.60775584", "0.60749376", "0.605659", "0.60524285", "0.60524285", "0.60519505", "0.60217625", "0.60191125", "0.60021234", "0.59959066", "0.5981107", "0.59555614", "0.59436643", "0.59...
0.634804
3
Construct a table of ``n`` rows with values 0 to ``n 1``. Examples
def range(cls, n, num_partitions=None): return Table(Env.hc(), Env.hail().keytable.KeyTable.range(Env.hc()._jhc, n, joption(num_partitions)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_table(m, n):\n return [[0] * n for _ in range(m)]", "def make_table(m, n):\n return np.array([[0] * n for _ in range(m)], dtype=float)", "def print_table(n):\n \n numbers = list(range(1, n + 1))\n\n #处理第一行\n s = ''\n for i in numbers:\n s = s + '\\t' + str(i)\n print(s)\...
[ "0.7958995", "0.77816135", "0.7426837", "0.6956827", "0.69276226", "0.6884985", "0.68799907", "0.6809293", "0.6792406", "0.67868716", "0.67725265", "0.6662255", "0.6645316", "0.6564681", "0.65141654", "0.65010977", "0.6437632", "0.6431976", "0.6427043", "0.6419895", "0.638887...
0.64690846
16
Retrieve information from the JSON file
def retrieve_json(cls): objectjson = json.loads(jsondata) listimdata = objectjson['imdata'] return listimdata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def openJson(self):\n json_file = open(self.file, 'r')\n json_data = json_file.read()\n result = json.loads(json_data)\n return result", "def read_json():\n json_path = Path.home() / Path(\"pdf2notion.json\")\n if json_path.exists():\n try:\n with open(json_pat...
[ "0.6853767", "0.6797417", "0.6786326", "0.67450976", "0.67321694", "0.6699633", "0.66700387", "0.6655471", "0.66167396", "0.6612033", "0.65899515", "0.65864915", "0.65595204", "0.6524792", "0.65120554", "0.64902824", "0.64585584", "0.64509267", "0.6446793", "0.64397424", "0.6...
0.0
-1
The initialization of the objects. Parsing all the dictionaries to create the objects
def obj_initialization(cls): listimdata = cls.retrieve_json() for elem in listimdata: CloudCtx.retrieve_from_json(elem)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n # initialise the empty mappings dictionary\n self.data = {\n 'loan_id': None,\n 'product': None,\n 'origination_date': None,\n 'reversion_date': None,\n 'rate_term': None,\n 'loan_amount'...
[ "0.72070545", "0.70372313", "0.7028998", "0.6978076", "0.69769096", "0.69736564", "0.6969441", "0.69118977", "0.6873467", "0.68470114", "0.6773582", "0.67551666", "0.67257124", "0.6720442", "0.66589004", "0.6652735", "0.665051", "0.6606847", "0.65824664", "0.65780383", "0.657...
0.6354604
60
Method used to sort the objects from low > highest of the currenthealth
def sort_currenthealth(cls): CloudCtx.objCloudCtx.sort(key=lambda x: x.currenthealth) for elem in CloudCtx.objCloudCtx: print(elem.display_cloud_ctx())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sort(self):\n self.population.sort()\n self.population.reverse()", "def order_by_fitness(self):\n self.fauna_list['Herbivore'].sort(key=operator.\n attrgetter('animal_fitness'))\n self.fauna_list['Carnivore'].sort(key=operator.\n ...
[ "0.6516192", "0.62642473", "0.61162984", "0.60903406", "0.60502887", "0.6042862", "0.6019754", "0.60002744", "0.60002744", "0.59838814", "0.591684", "0.59040284", "0.5897962", "0.5884195", "0.5877887", "0.58615667", "0.5833206", "0.5787725", "0.57582235", "0.57577944", "0.575...
0.6984742
0
Method used to sort the object from the most recent > oldest of the ModTs
def sort_time(cls): CloudCtx.objCloudCtx.sort(key=lambda x: datetime.strptime(x.modTs, "%d-%m-%Y %I:%M:%S %p"), reverse=True) for elem in CloudCtx.objCloudCtx: print(elem.display_cloud_ctx())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_time(self):\n self.entries.sort(key=lambda x: x.date_stamp_utc)", "def ordered(cls, objs):\n objs = list(objs)\n try:\n objs.sort(key=lambda o: o.latest_message.created, reverse=True)\n except:\n pass\n return objs", "def sort_func(structure):\n...
[ "0.70845073", "0.68521047", "0.6726505", "0.6577848", "0.6467773", "0.63470227", "0.6272858", "0.6196068", "0.6070657", "0.6069999", "0.60673904", "0.6062679", "0.6034882", "0.5974211", "0.5960721", "0.59501314", "0.59469956", "0.5939441", "0.5937328", "0.592779", "0.59100187...
0.6044759
12
Return a string containing the subtree's preorder traversal.
def text_display(self, indent): result = " " * indent + self.name + "\n" if self.left_child != None: result += self.left_child.text_display(indent + 4) if self.right_child != None: result += self.right_child.text_display(indent + 4) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_order_traversal(self, subtree, traversal_str):\n if subtree:\n traversal_str += (str(subtree.value) + \"-\")\n traversal_str = self.pre_order_traversal(subtree.left, traversal_str)\n traversal_str = self.pre_order_traversal(subtree.right, traversal_str)\n retu...
[ "0.7988075", "0.79693705", "0.7458411", "0.7342385", "0.7297656", "0.72249544", "0.7189005", "0.7182681", "0.7178524", "0.71656966", "0.714359", "0.714359", "0.7123335", "0.70948267", "0.70789385", "0.70657724", "0.7022395", "0.69705456", "0.68433124", "0.6791813", "0.6750374...
0.0
-1
Add the value to the tree.
def add(self): value = int(self.value_entry.get()) self.value_entry.delete(0, tk.END) self.value_entry.focus_force() self.root.add_node(value) self.draw_tree()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, value: T) -> None:\n child_node = Tree(value)\n self.children.append(child_node)", "def add(self, value):\n self.children.append(Node(value))", "def add(self, value):\n if self.root is None:\n self.root = BinaryNode(value) \n else:\n self.r...
[ "0.82130563", "0.81409794", "0.79699564", "0.78386575", "0.7809919", "0.7657727", "0.7584413", "0.7560321", "0.7547733", "0.7492815", "0.74546003", "0.7408211", "0.734689", "0.72792923", "0.7265218", "0.7216724", "0.715495", "0.7102335", "0.7001337", "0.6933806", "0.68869054"...
0.7567262
7
Sequence and subclasses should init correctly.
def test_init_empty(self): # NOTE: ModelSequences can't be initialized empty because it screws up # the dimensions of the array, and not worth special-casing. s = self.SEQ() self.assertEqual(s, "") assert s.moltype in (ASCII, BYTES) r = self.RNA() assert r.moltyp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n self.sequence = []", "def __init__(self, name, seq):", "def __init__(self, sequence):\n self._seq = sequence # Copy of the given data.\n # Reference to the underlying data, will increment to 0 on first call\n # to next element.\n self._k = -1", "def...
[ "0.803836", "0.7566621", "0.729322", "0.7015981", "0.7007567", "0.7004212", "0.69812244", "0.69781005", "0.6919733", "0.6902574", "0.68424964", "0.68386805", "0.6807607", "0.6807607", "0.6807607", "0.68065834", "0.6752115", "0.67197514", "0.671689", "0.6709558", "0.6709558", ...
0.0
-1
Sequence init with data should set data in correct location
def test_init_data(self): r = self.RNA("ucagg") # no longer preserves case self.assertEqual(r, "UCAGG")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, sequence):\n self._seq = sequence # Copy of the given data.\n # Reference to the underlying data, will increment to 0 on first call\n # to next element.\n self._k = -1", "def __init__(self):\n\n self.sequence = []", "def _init_sample(self):\n self.t...
[ "0.70355034", "0.6822572", "0.6405187", "0.6313736", "0.6230948", "0.6168041", "0.60989046", "0.60941994", "0.6078092", "0.6071442", "0.60669416", "0.60627884", "0.6033688", "0.6033476", "0.6027345", "0.6025648", "0.6015381", "0.5983073", "0.5970288", "0.5957618", "0.5944549"...
0.0
-1
correctly convert bytes to str
def test_init_from_bytes(self): s = self.SEQ(b"ACGT") self.assertEqual(s, "ACGT")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytes_to_str(self, data):\n if isinstance(data, str):\n return data\n return data.decode(\"utf-8\")", "def bytes2str(val):\n if isinstance(val, bytes):\n return str(val, \"utf8\")\n else:\n return val", "def _bytes_bytearray_to_str(s):\n if isinstance(s, (byt...
[ "0.82695866", "0.81003517", "0.7880212", "0.7813384", "0.75571394", "0.7528833", "0.7525016", "0.7474845", "0.74673426", "0.74233854", "0.741692", "0.7299766", "0.72641987", "0.72641987", "0.7259258", "0.7249842", "0.72468895", "0.7186462", "0.7143656", "0.7097049", "0.709050...
0.0
-1
Sequence init with other seq should preserve name and info.
def test_init_other_seq(self): r = self.RNA("UCAGG", name="x", info={"z": 3}) s = Sequence(r) self.assertEqual(s._seq, "UCAGG") self.assertEqual(s.name, "x") self.assertEqual(s.info.z, 3)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, name, seq):", "def __init__(self, name, sequence, description=None, seq_type=None):\n self.name = name\n self.description = description\n self.seq_type = seq_type\n self._sequence = sequence", "def __init__(self, seq_name, seed=0, hashable=False):\n self.__...
[ "0.73695916", "0.64641666", "0.6406861", "0.63860846", "0.6326368", "0.6289234", "0.62387466", "0.62214434", "0.61863655", "0.6182251", "0.6173626", "0.608901", "0.6055515", "0.6053556", "0.60087323", "0.59916127", "0.5978379", "0.5969416", "0.59500825", "0.59398437", "0.5890...
0.7811066
0
correctly returns a copy version of self
def test_copy(self): s = Sequence("TTTTTTTTTTAAAA", name="test_copy") annot1 = s.add_annotation(Feature, "exon", "annot1", [(0, 10)]) annot2 = s.add_annotation(Feature, "exon", "annot2", [(10, 14)]) got = s.copy() got_annot1 = got.get_annotations_matching( annotation_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _copy_(self):\n return copy.copy(self)", "def __copy__(self):\n return self.copy()", "def copy(self):", "def copy(self):\n return super().copy()", "def __copy__(self, *args, **kwargs):\n return self.copy()", "def copy(self):\r\n return copy.copy(self)", "def copy(...
[ "0.8468353", "0.8455583", "0.84065545", "0.8386275", "0.8119973", "0.8095706", "0.80693597", "0.80693597", "0.80110604", "0.80110604", "0.80110604", "0.80110604", "0.79920405", "0.79704064", "0.79704064", "0.79704064", "0.79509676", "0.794571", "0.7930331", "0.7901515", "0.79...
0.0
-1
Sequence should compare equal to same string.
def test_compare_to_string(self): r = self.RNA("UCC") self.assertEqual(r, "UCC")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_strings_are_equal(self):\n string1 = 'this is the first string'\n string2 = 'this is the first string' # ==, !is\n string3 = 'this is the second string'\n self.assertEqual(True, comparator.strings_are_equal(string1, string2))\n self.assertEqual(False, comparator.strings_...
[ "0.69024533", "0.66927505", "0.6671877", "0.6619351", "0.65525943", "0.64880276", "0.6398488", "0.63894767", "0.6379811", "0.6285529", "0.62052613", "0.6203716", "0.61814064", "0.6093277", "0.60751796", "0.6057104", "0.6041473", "0.6041473", "0.6041473", "0.59970266", "0.5996...
0.5483892
87
Sequence slicing should work as expected
def test_slice(self): r = self.RNA("UCAGG") self.assertEqual(r[0], "U") self.assertEqual(r[-1], "G") self.assertEqual(r[1:3], "CA")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slicer(seq, start=None, stop=None, step=None):\n return seq[start:stop:step]", "def SliceView(sequence, start=None, stop=None, step=1):\n start, stop, step = slice(start, stop, step).indices(len(sequence))\n for i in range(start, stop, step):\n yield sequence[i]", "def _shifted(self, aslice...
[ "0.76085573", "0.6842696", "0.6784009", "0.6566867", "0.64801246", "0.6462902", "0.6415221", "0.6349267", "0.6320076", "0.62818056", "0.6269232", "0.6247975", "0.6244434", "0.6231251", "0.6221761", "0.62118554", "0.62083834", "0.6200476", "0.6195259", "0.61610466", "0.6138917...
0.5722164
59
Should convert t to u automatically
def test_conversion(self): r = self.RNA("TCAtu") self.assertEqual(str(r), "UCAUU") d = self.DNA("UCAtu") self.assertEqual(str(d), "TCATT")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def t2u( self , t ):\n \n # Default is a constant signal\n u = self.ubar\n \n return u", "def t2u( self , t ):\n \n # Input of closed-loop global sys is ref of the controller\n u = self.controller.t2r(t)\n \n return u", "def u2fkn( self , u ...
[ "0.7034789", "0.65504295", "0.64199305", "0.6382512", "0.6213961", "0.6210542", "0.6179763", "0.61491317", "0.6059154", "0.6027211", "0.5952965", "0.59272766", "0.58470494", "0.5811453", "0.5773575", "0.57254016", "0.57064253", "0.57055706", "0.57030517", "0.57023585", "0.566...
0.0
-1
Returns copy of self as DNA.
def test_to_dna(self): r = self.RNA("TCA") self.assertEqual(str(r), "UCA") self.assertEqual(str(r.to_dna()), "TCA")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dna(self):\n return self.seq.replace('U', 'T').replace('u', 't')", "def to_rna(self):\n return \"\".join(self._DNA_TO_RNA[nt] for nt in self.strand)", "def __init__(self, dna):\n self.dna = dna", "def RNAorDNA ( seq ) :\n\tif dna_regex . search ( seq ):\n\t\treturn RNA ( seq )\n\n\tif rn...
[ "0.6853639", "0.66468394", "0.61654574", "0.6162918", "0.6142415", "0.605051", "0.59168273", "0.5909715", "0.5885424", "0.585986", "0.5852518", "0.57932264", "0.5737929", "0.5710305", "0.5670048", "0.56377673", "0.56370986", "0.5636992", "0.56280196", "0.55856353", "0.5545051...
0.5809278
11
Returns copy of self as RNA.
def test_to_rna(self): r = self.DNA("UCA") self.assertEqual(str(r), "TCA") self.assertEqual(str(r.to_rna()), "UCA")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_rna(self):\n return \"\".join(self._DNA_TO_RNA[nt] for nt in self.strand)", "def rna(self):\n return self.seq.replace('T', 'U').replace('t', 'u')", "def to_rna(self):\n thymidine = 'T'\n uracil = 'U'\n return self.dna.replace(thymidine, uracil)", "def to_rna(self):\n retu...
[ "0.7086926", "0.6499243", "0.6490486", "0.63800514", "0.63091546", "0.6080952", "0.57973856", "0.57460046", "0.57460046", "0.5709716", "0.56820047", "0.5672864", "0.5625302", "0.5621346", "0.55915904", "0.554945", "0.5540344", "0.5539744", "0.5526546", "0.5500591", "0.54775",...
0.54868966
20
Sequence to_fasta() should return Fastaformat string
def test_to_fasta(self): even = "TCAGAT" odd = even + "AAA" even_dna = self.SEQ(even, name="even") odd_dna = self.SEQ(odd, name="odd") self.assertEqual(even_dna.to_fasta(), ">even\nTCAGAT\n") # set line wrap to small number so we can test that it works self.assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_to_fasta(self):\n even = \"TCAGAT\"\n odd = even + \"AAA\"\n even_dna = self.SequenceClass(even, name=\"even\")\n odd_dna = self.SequenceClass(odd, name=\"odd\")\n self.assertEqual(even_dna.to_fasta(), \">even\\nTCAGAT\\n\")\n # set line wrap to small number so we...
[ "0.74931866", "0.7302847", "0.70808065", "0.6741352", "0.67153966", "0.67040503", "0.6695643", "0.66434294", "0.66212684", "0.6602914", "0.6531266", "0.65176135", "0.65008026", "0.6492443", "0.648414", "0.64614666", "0.638201", "0.6333177", "0.6327045", "0.62993723", "0.62658...
0.74317557
1
Sequence should be serializable
def test_serialize(self): r = self.RNA("ugagg") assert dumps(r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seq(self): # (pure virtual)\n raise NotImplementedError", "def sequence(self) -> Any:\n return self.__seq", "def encode(self, seq):", "def sequence_params(self):", "def write_sequence(list):\n pass", "def _get_sequence(self):\n return self.__sequence", "def _get_sequence(se...
[ "0.6805777", "0.6668091", "0.65409726", "0.647106", "0.643973", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0.6417241", "0...
0.0
-1
to_json roundtrip recreates to_dict
def test_to_json(self): r = self.SEQ("AAGGCC", name="seq1") got = json.loads(r.to_json()) expect = { "name": "seq1", "seq": "AAGGCC", "moltype": r.moltype.label, "info": None, "type": get_object_provenance(r), "version": __v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_json(self):\n return self.__dict__", "def to_json(self):\n return json.dumps(self._asdict())", "def to_json(self) -> JSON:\n pass", "def to_json(self):\n return json.dumps(self.dict)", "def to_json(self):\n pass", "def to_json(self) -> Dict[str, Any]:\n ...
[ "0.7552009", "0.7524641", "0.7481134", "0.744547", "0.7408717", "0.7337756", "0.7278776", "0.7213186", "0.71728194", "0.7155692", "0.71395344", "0.71390843", "0.71071094", "0.71071094", "0.7083252", "0.70830005", "0.7071695", "0.7064127", "0.7064127", "0.7048656", "0.7048656"...
0.0
-1
correctly convert to specified moltype
def test_sequence_to_moltype(self): s = Sequence("TTTTTTTTTTAAAA", name="test1") annot1 = s.add_annotation(Feature, "exon", "fred", [(0, 10)]) annot2 = s.add_annotation(Feature, "exon", "trev", [(10, 14)]) got = s.to_moltype("rna") annot1_slice = str(annot1.get_slice()) a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_type(self, value, schema_type, **kwargs):", "def test_serialization_no_conformers(self):\n mol = Molecule.from_smiles(\"CCO\")\n\n dict_copy = Molecule.from_dict(mol.to_dict())\n assert mol == dict_copy\n\n # TODO: yaml_copy = Molecule.from_yaml(mol.to_yaml())\n wit...
[ "0.59675646", "0.5934169", "0.5934169", "0.58525664", "0.584084", "0.5832174", "0.5809657", "0.57892466", "0.5709961", "0.56273437", "0.5619032", "0.55968195", "0.55924606", "0.55757135", "0.5488384", "0.5469854", "0.5443067", "0.54244196", "0.53944826", "0.53856766", "0.5381...
0.53021723
24
correctly annotates a Sequence from a gff file
def test_annotate_from_gff(self): from cogent3.parse.fasta import FastaParser fasta_path = os.path.join("data/c_elegans_WS199_dna_shortened.fasta") gff3_path = os.path.join("data/c_elegans_WS199_shortened_gff.gff3") name, seq = next(FastaParser(fasta_path)) sequence = Sequence(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gff2FA(annotation, sequence, windows, output):\n df_gff = pd.read_csv(annotation, index_col=False, sep='\\t', header=None, comment=\"#\")\n df_gff.columns = ['seqname', 'source', 'feature', 'start', 'end', 'score', 'strand', 'frame', 'attribute']\n fasta_seq = SeqIO.parse(sequence, 'fasta')\n buffe...
[ "0.68458533", "0.6741979", "0.64248884", "0.6258323", "0.62455755", "0.61349237", "0.6114975", "0.6035717", "0.6020976", "0.5951338", "0.5917856", "0.5893167", "0.5850203", "0.58161116", "0.58051586", "0.5799951", "0.5758082", "0.57514256", "0.57467973", "0.57466453", "0.5679...
0.6810655
1
Sequence strip_degenerate should remove any degenerate bases
def test_strip_degenerate(self): self.assertEqual(self.RNA("UCAG-").strip_degenerate(), "UCAG-") self.assertEqual(self.RNA("NRYSW").strip_degenerate(), "") self.assertEqual(self.RNA("USNG").strip_degenerate(), "UG")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleaning_ambiguous_bases(seq):\n # compile the regex with all ambiguous bases\n pat = re.compile(r'[NRYWXSKM]')\n # look for the ambiguous bases and replace by\n # nothing\n return re.sub(pat, '', seq)", "def degenerate2(s):\n from lasagna.utils import base_repr\n\n n = s.count('N')\...
[ "0.670461", "0.6552507", "0.5997409", "0.5994004", "0.59098065", "0.58974713", "0.5855396", "0.58462846", "0.5815244", "0.5701709", "0.56765515", "0.5675322", "0.5673388", "0.5557388", "0.55281866", "0.55277646", "0.55103743", "0.5502395", "0.548646", "0.5485527", "0.53843564...
0.7007799
0
Sequence strip_bad should remove any nonbase, nongap chars
def test_strip_bad(self): # have to turn off check to get bad data in; no longer preserves case self.assertEqual( self.RNA("UCxxxAGwsnyrHBNzzzD-D", check=False).strip_bad(), "UCAGWSNYRHBND-D", ) self.assertEqual(self.RNA("@#^*($@!#&()!@QZX", check=False).strip_bad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_other_charcter():\n pass", "def test_strip_bad(self):\n # have to turn off check to get bad data in; no longer preserves case\n r = self.RNA(\"UCAGRYU\")\n r._data[0] = 31\n r._data[2] = 55\n self.assertEqual(r.strip_bad(), \"CGRYU\")", "def _strip_invalid_xml(s)...
[ "0.715122", "0.70498705", "0.69027036", "0.69027036", "0.68354553", "0.67104006", "0.66530055", "0.65649366", "0.65649366", "0.65639234", "0.65602666", "0.653047", "0.65097004", "0.6500392", "0.64983284", "0.6485774", "0.64769524", "0.6473822", "0.6450652", "0.6406869", "0.64...
0.7429765
0
Sequence strip_bad_and_gaps should remove gaps and bad chars
def test_strip_bad_and_gaps(self): # have to turn off check to get bad data in; no longer preserves case self.assertEqual( self.RNA("UxxCAGwsnyrHBNz#!D-D", check=False).strip_bad_and_gaps(), "UCAGWSNYRHBNDD", ) self.assertEqual( self.RNA("@#^*($@!#&()!...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_strip_bad_and_gaps(self):\n # have to turn off check to get bad data in; no longer preserves case\n r = self.RNA(\"ACG--GRN?\")\n self.assertEqual(r.strip_bad_and_gaps(), \"ACGGRN\")\n r._data[0] = 99\n self.assertEqual(r.strip_bad_and_gaps(), \"CGGRN\")", "def ungappe...
[ "0.7566995", "0.6872599", "0.686638", "0.6582646", "0.6464975", "0.6438769", "0.63625026", "0.6273571", "0.6273571", "0.6253653", "0.6191777", "0.6101316", "0.60952926", "0.6083035", "0.602748", "0.60102254", "0.59808695", "0.5978832", "0.5978832", "0.59764034", "0.59651965",...
0.76906425
0
Sequence shuffle should return new random sequence w/ same monomers
def test_shuffle(self): r = self.RNA("UUUUCCCCAAAAGGGG") s = r.shuffle() self.assertNotEqual(r, s) self.assertEqualItems(r, s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_shuffle(self):\n random.shuffle(self.seq)\n self.seq.sort()\n self.assertEqual(self.seq, range(10))", "def shuffle(self):\n for i in xrange(self.n - 1):\n pos = random.randint(i, self.n - 1)\n self.to[i], self.to[pos] = self.to[pos], self.to[i]\n ...
[ "0.74236465", "0.70922947", "0.70799804", "0.7030679", "0.6991424", "0.6946981", "0.68759125", "0.68759125", "0.681591", "0.6815623", "0.6789187", "0.67795455", "0.67775214", "0.6772275", "0.67656815", "0.67480785", "0.6738267", "0.6738267", "0.6738267", "0.6738267", "0.67382...
0.7527803
0
Sequence complement should correctly complement sequence
def test_complement(self): self.assertEqual(self.RNA("UAUCG-NR").complement(), "AUAGC-NY") self.assertEqual(self.DNA("TATCG-NR").complement(), "ATAGC-NY") self.assertEqual(self.DNA("").complement(), "") self.assertRaises(TypeError, self.PROT("ACD").complement)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse_complement(seq):\n seq = reverse(seq)\n seq = complement(seq)\n return seq", "def complement(seq,transl=None):\n transl = string.maketrans('aAcCgGtTnNxX-\\t\\n ','tTgGcCaAnNxX-\\t\\n ')\n compl = seq.translate(transl)\n return compl", "def reverseComplement(seq):\n seq=seq.uppe...
[ "0.7623554", "0.75091016", "0.7502224", "0.73210824", "0.7235925", "0.7200215", "0.7198885", "0.71950966", "0.7168782", "0.7153399", "0.7142724", "0.7064332", "0.69271415", "0.69014627", "0.6875381", "0.68182236", "0.6790817", "0.6774035", "0.6736192", "0.6675863", "0.6652226...
0.59160876
65
Sequence rc should correctly reversecomplement sequence
def test_rc(self): # no longer preserves case! self.assertEqual(self.RNA("UauCG-NR").rc(), "YN-CGAUA") self.assertEqual(self.DNA("TatCG-NR").rc(), "YN-CGATA") self.assertEqual(self.RNA("").rc(), "") self.assertEqual(self.RNA("A").rc(), "U") self.assertRaises(TypeError, se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse_complement(sequence):\n return sequence[::-1].translate(RC_TRANS)", "def reverse_complement(seq):\n seq = reverse(seq)\n seq = complement(seq)\n return seq", "def reverseComplement(seq):\n seq=seq.upper()\n # complement\n compl = complement(seq)\n # reverse\n return compl...
[ "0.75878507", "0.74322444", "0.73540044", "0.73068404", "0.7297223", "0.72609305", "0.7245406", "0.6864388", "0.6825177", "0.6751749", "0.6696905", "0.66855085", "0.6634271", "0.6524868", "0.6521012", "0.6498395", "0.6479143", "0.6474428", "0.64730465", "0.6471708", "0.644590...
0.0
-1
Sequence contains should return correct result
def test_contains(self): r = self.RNA("UCA") assert "U" in r assert "CA" in r assert "X" not in r assert "G" not in r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains__(self, item):\n index = bisect_left(self.sequence, item)\n if (len(self.sequence) != index) and (self.sequence[index] == item):\n return True\n return False", "def __contains__(self, seq):\n return bool(libhts.faidx_has_seq(self._fai, seq))", "def find(ss,...
[ "0.67929125", "0.6677104", "0.6641281", "0.66016376", "0.65982497", "0.65745986", "0.6532576", "0.65057534", "0.6472483", "0.6450589", "0.6450589", "0.6435785", "0.6427775", "0.6368751", "0.6295642", "0.62828726", "0.6253389", "0.62221736", "0.61981094", "0.61706203", "0.6144...
0.59879863
41
Sequence iter should iterate over sequence
def test_iter(self): p = self.PROT("QWE") self.assertEqual(list(p), ["Q", "W", "E"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n for x in self.seq: yield x", "def __iter__(self) -> Generator:\r\n yield from self.sequence", "def iterator(self):\n yield", "def __iter__():", "def __iter__():", "def __iter__():", "def __iter__():", "def iter_sequence(self):\n for res_name, fragment...
[ "0.8192315", "0.79424095", "0.74353033", "0.73842824", "0.73842824", "0.73842824", "0.73842824", "0.72320265", "0.7194424", "0.70451206", "0.703375", "0.7024796", "0.7024796", "0.7024796", "0.7024796", "0.7024796", "0.70171726", "0.6973403", "0.6973403", "0.6963762", "0.69568...
0.0
-1
Sequence is_gapped should return True if gaps in seq
def test_is_gapped(self): assert not self.RNA("").is_gapped() assert not self.RNA("ACGUCAGUACGUCAGNRCGAUcaguaguacYRNRYRN").is_gapped() assert self.RNA("-").is_gapped() assert self.PROT("--").is_gapped() assert self.RNA("CAGUCGUACGUCAGUACGUacucauacgac-caguACUG").is_gapped() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_gapped(sequence):\n w_regexp = re.compile('n|N')\n regexp_obj = w_regexp.search(sequence)\n if (regexp_obj):\n return True\n else:\n return False", "def test_gaps(self):\n sc = self.SequenceClass\n self.assertEqual(sc(\"TC\").gaps(), array([0, 0]))\n self....
[ "0.7141037", "0.67784256", "0.67448986", "0.6727662", "0.65542555", "0.653046", "0.6523505", "0.64914227", "0.64607525", "0.6435632", "0.6330339", "0.63285995", "0.62356126", "0.6230892", "0.6196477", "0.6066777", "0.6063414", "0.60388756", "0.60094523", "0.60034615", "0.5992...
0.59874135
22
Sequence is_gap should return True if char is a valid gap char
def test_is_gap(self): r = self.RNA("ACGUCAGUACGUCAGNRCGAUcaguaguacYRNRYRN") for char in "qwertyuiopasdfghjklzxcvbnmQWERTYUIOASDFGHJKLZXCVBNM": assert not r.is_gap(char) assert r.is_gap("-") # only works on a single literal that's a gap, not on a sequence. # possibly,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_gaps(s, gapcode=45):\r\n return nonzero(fromstring(s, dtype=uint8) == gapcode)", "def find_gaps(s, gapcode=45):\n return nonzero(fromstring(s,dtype=uint8) == gapcode)", "def checkForNOrGap(character):\n if character == \"-\" or character == \"N\":\n return False\n else:\n ret...
[ "0.72288585", "0.7180023", "0.7167158", "0.7167158", "0.68990767", "0.68299943", "0.65973693", "0.6557601", "0.64990675", "0.64894366", "0.63977575", "0.6362843", "0.6229104", "0.61301273", "0.60077465", "0.5992771", "0.5968189", "0.59411037", "0.593851", "0.5772497", "0.5726...
0.8379988
0
Sequence is_degenerate should return True if degen symbol in seq
def test_is_degenerate(self): assert not self.RNA("").is_degenerate() assert not self.RNA("UACGCUACAUGuacgucaguGCUAGCUA---ACGUCAG").is_degenerate() assert self.RNA("N").is_degenerate() assert self.RNA("R").is_degenerate() assert self.RNA("y").is_degenerate() assert self.R...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_consistent_gap_degen_handling(self):\n # the degen character '?' can be a gap, so when we strip either gaps or\n # degen characters it should be gone too\n raw_seq = \"---??-??TC-GGCG-GCA-G-GC-?-C-TAN-GCGC-CCTC-AGGA?-???-??--\"\n raw_ungapped = re.sub(\"[-?]\", \"\", raw_seq)\n...
[ "0.6201668", "0.6091381", "0.6069485", "0.59473264", "0.59035546", "0.5826139", "0.57964295", "0.5788602", "0.57822496", "0.57488996", "0.5700209", "0.56820357", "0.5671976", "0.56627655", "0.5661535", "0.56607664", "0.56530017", "0.563402", "0.5610719", "0.5593537", "0.55397...
0.7355169
0
Sequence is_strict should return True if all symbols in Monomers
def test_is_strict(self): assert self.RNA("").is_strict() assert self.PROT("A").is_strict() assert self.RNA("UAGCACUgcaugcauGCAUGACuacguACAUG").is_strict() assert not self.RNA("CAGUCGAUCA-cgaucagUCGAUGAC").is_strict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_atomic(self):\n \n symbols=set()\n for e in self.symbols:\n if not e=='':\n symbols.add(e)\n\n for s in symbols: #unicity first\n count=0\n for e in symbols:\n if s==e:\n count+=1\n if c...
[ "0.59880435", "0.5868502", "0.57117075", "0.5693459", "0.56859756", "0.5625319", "0.55478084", "0.5500837", "0.5423727", "0.5399986", "0.5368656", "0.53295964", "0.53133947", "0.52879006", "0.5250921", "0.5220573", "0.5218399", "0.5208652", "0.5200181", "0.5194953", "0.517377...
0.7072339
0
Sequence first_gap should return index of first gap symbol, or None
def test_first_gap(self): self.assertEqual(self.RNA("").first_gap(), None) self.assertEqual(self.RNA("a").first_gap(), None) self.assertEqual(self.RNA("uhacucHuhacUUhacan").first_gap(), None) self.assertEqual(self.RNA("-abc").first_gap(), 0) self.assertEqual(self.RNA("b-ac").firs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(seq):\n return next(iter(seq))", "def _substitute_opening_gap_char(seq):\n newseq=list(seq)\n iterator=rex.finditer(seq)\n for match in iterator:\n try:\n newseq[match.span()[1]-1]=\"|\"\n except:\n continue\n return \"\".join(newseq)", "def test_is_...
[ "0.62938017", "0.5901865", "0.58401036", "0.5820655", "0.58202505", "0.58202505", "0.5801659", "0.5738459", "0.57372636", "0.5688006", "0.5682002", "0.5681534", "0.56456417", "0.5599555", "0.5591629", "0.5551406", "0.552724", "0.5501178", "0.5490658", "0.545651", "0.54537", ...
0.75103754
0
Sequence first_degenerate should return index of first degen symbol
def test_first_degenerate(self): self.assertEqual(self.RNA("").first_degenerate(), None) self.assertEqual(self.RNA("a").first_degenerate(), None) self.assertEqual(self.RNA("UCGACA--CU-gacucaguacgua").first_degenerate(), None) self.assertEqual(self.RNA("nCAGU").first_degenerate(), 0) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def firstNotRepeatingCharacter(s):\n\n # even positions = number of characters\n # odd positions = last occurrence of that character\n scounter = [0] * 52\n\n for i in range(len(s)):\n char_pos = (ord(s[i]) - 97) * 2\n scounter[char_pos] += 1\n scounter[char_pos + 1] = i\n\n las...
[ "0.629569", "0.61979645", "0.61258584", "0.5994529", "0.59364647", "0.59274447", "0.5868857", "0.5833778", "0.57321924", "0.56907326", "0.567017", "0.5665031", "0.5656412", "0.56558704", "0.56542057", "0.5627427", "0.5622604", "0.56069934", "0.5604781", "0.5595544", "0.558563...
0.67240775
0
Sequence first_non_strict should return index of first nonstrict symbol
def test_first_non_strict(self): self.assertEqual(self.RNA("").first_non_strict(), None) self.assertEqual(self.RNA("A").first_non_strict(), None) self.assertEqual(self.RNA("ACGUACGUcgaucagu").first_non_strict(), None) self.assertEqual(self.RNA("N").first_non_strict(), 0) self.ass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(word):\n\treturn word[0]", "def _find_index(string):\n if string[0] == 'X':\n return 0\n elif string == 'D':\n return 1\n else:\n return np.where(sym == string)[0][0]", "def first(seq):\n return next(iter(seq))", "def test_strings_first_symbol():\n\n first_resul...
[ "0.6179377", "0.61144847", "0.60682476", "0.6048123", "0.60406363", "0.5949297", "0.5831545", "0.58217716", "0.5802844", "0.57483494", "0.57339954", "0.57324356", "0.5702078", "0.56688476", "0.5591062", "0.5555485", "0.55398554", "0.5539652", "0.55382264", "0.5532169", "0.552...
0.7133279
0
Sequence disambiguate should remove degenerate bases
def test_disambiguate(self): self.assertEqual(self.RNA("").disambiguate(), "") self.assertEqual( self.RNA("AGCUGAUGUA--CAGU").disambiguate(), "AGCUGAUGUA--CAGU" ) self.assertEqual( self.RNA("AUn-yrs-wkmCGwmrNMWRKY").disambiguate("strip"), "AU--CG" ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleaning_ambiguous_bases(seq):\n # compile the regex with all ambiguous bases\n pat = re.compile(r'[NRYWXSKM]')\n # look for the ambiguous bases and replace by\n # nothing\n return re.sub(pat, '', seq)", "def back_translate(self):\n base = Bio.Alphabet._get_base_alphabet(self.alphabet)\...
[ "0.7825706", "0.632825", "0.62402546", "0.5868822", "0.58633727", "0.5861185", "0.58539385", "0.5849037", "0.57864356", "0.5770885", "0.569351", "0.5685995", "0.55985564", "0.5540336", "0.55358434", "0.5530427", "0.5522565", "0.5515272", "0.55127937", "0.5512095", "0.55023056...
0.67777115
1
Sequence degap should remove all gaps from sequence
def test_degap(self): # doesn't preserve case self.assertEqual(self.RNA("").degap(), "") self.assertEqual( self.RNA("GUCAGUCgcaugcnvuncdks").degap(), "GUCAGUCGCAUGCNVUNCDKS" ) self.assertEqual(self.RNA("----------------").degap(), "") self.assertEqual(self.RNA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_4s_every_other_in_between(seq):\n seq_copy = seq [4:-4:2]\n return seq_copy", "def fours_removed(seq):\n length = len(seq) - 4\n new_seq = seq[4:length:2]\n return new_seq", "def remove_four_and_every_other(seq):\n # Make a copy of the original sequence, but omit the first four and...
[ "0.7178334", "0.66512275", "0.66408855", "0.6613794", "0.6336266", "0.63346887", "0.63340145", "0.63059574", "0.62291336", "0.62070405", "0.6177452", "0.60648733", "0.6061727", "0.60574627", "0.6001601", "0.5919394", "0.58573335", "0.58538324", "0.58010304", "0.57552475", "0....
0.0
-1
Sequence gap_indices should return correct gap positions
def test_gap_indices(self): self.assertEqual(self.RNA("").gap_indices(), []) self.assertEqual(self.RNA("ACUGUCAGUACGHSDKCUCDNNS").gap_indices(), []) self.assertEqual(self.RNA("GUACGUACAKDC-SDHDSK").gap_indices(), [12]) self.assertEqual(self.RNA("-DSHUHDS").gap_indices(), [0]) sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gap_indices(self):\n r = self.RNA(\"-?A-?NRY-\")\n v = r.gap_indices()\n self.assertEqual(v, array([0, 1, 3, 4, 8]))\n r = self.RNA(\"AC\")\n v = r.gap_indices()\n self.assertEqual(v, array([])) # note: always returns array\n r = self.RNA(\"-?\")\n ...
[ "0.6974337", "0.6601554", "0.64816505", "0.63461", "0.6027567", "0.5972312", "0.5915429", "0.586718", "0.58583003", "0.58261764", "0.5799375", "0.5784183", "0.57565933", "0.57559055", "0.57435954", "0.57185775", "0.5682374", "0.56467414", "0.56163996", "0.5611873", "0.561138"...
0.74248666
0
Sequence gap_vector should return correct gap positions
def test_gap_vector(self): def g(x): return self.RNA(x).gap_vector() self.assertEqual(g(""), []) self.assertEqual(g("ACUGUCAGUACGHCSDKCCUCCDNCNS"), [False] * 27) self.assertEqual( g("GUACGUAACAKADC-SDAHADSAK"), list(map(bool, list(map(int, "000000000...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaps(self):\n return self.gaps_L + self.gaps_R", "def get_gaps( rows ):\n\n n = len(rows) - 1\n gaps = [ rows[i+1][0]-rows[i][1] for i in range(n) ]\n return gaps", "def pos_gaps(df, gaps):\n nb_rows, nb_cols = df.shape\n\n value_counts = df.apply(pd.Series.value_counts, axis=0)#.max(axis...
[ "0.69004416", "0.6682347", "0.6234445", "0.61394644", "0.6135273", "0.6029227", "0.5996346", "0.596874", "0.59524286", "0.58817637", "0.5849354", "0.58274347", "0.5820121", "0.5768506", "0.57642204", "0.5745565", "0.5728751", "0.5723446", "0.5646391", "0.56260604", "0.5612469...
0.71960086
0
Sequence gap_maps should return dicts mapping gapped/ungapped pos
def test_gap_maps(self): empty = "" no_gaps = "aaa" all_gaps = "---" start_gaps = "--abc" end_gaps = "ab---" mid_gaps = "--a--b-cd---" def gm(x): return self.RNA(x).gap_maps() self.assertEqual(gm(empty), ({}, {})) self.assertEqual(gm(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_labeled_sequence_gaps(source_seq, test_seq):\n slot_vals = {} \n tmp_gap = []\n prev_word_pos = 0 # the temp value used as a key for the gaps\n pos_in_seq = 0 # position of source_seq of test_seq's current match\n for i, el in enumerate(test_seq):\n if (len(source_seq)-pos_in_s...
[ "0.69372344", "0.6512925", "0.6227912", "0.61309123", "0.6124416", "0.5984851", "0.5867605", "0.58508515", "0.58421373", "0.5823585", "0.5815825", "0.5779069", "0.5761891", "0.57431996", "0.5677936", "0.56523556", "0.565037", "0.5649766", "0.5629222", "0.5621352", "0.56200445...
0.7045853
0
Sequence count_gaps should return correct gap count
def test_count_gaps(self): self.assertEqual(self.RNA("").count_gaps(), 0) self.assertEqual(self.RNA("ACUGUCAGUACGHSDKCUCDNNS").count_gaps(), 0) self.assertEqual(self.RNA("GUACGUACAKDC-SDHDSK").count_gaps(), 1) self.assertEqual(self.RNA("-DSHUHDS").count_gaps(), 1) self.assertEqua...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaps(self):\n return self.gaps_L + self.gaps_R", "def test_count_gaps(self):\n field = Field.create()\n self.assertEqual(field.count_gaps(), 0)\n\n field = Field.create(generate_valid_state(np.array([\n [1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [1, 0, 1, 0, 1, 1, 1, 1, 1...
[ "0.7305668", "0.7114037", "0.7099929", "0.70482856", "0.6948094", "0.66506445", "0.6569017", "0.63222957", "0.630426", "0.62556726", "0.6229864", "0.6227019", "0.6073235", "0.606868", "0.60536516", "0.60394436", "0.6031358", "0.60159504", "0.6010219", "0.5927962", "0.5903605"...
0.6936065
5
Sequence count_degenerate should return correct degen base count
def test_count_degenerate(self): self.assertEqual(self.RNA("").count_degenerate(), 0) self.assertEqual(self.RNA("GACUGCAUGCAUCGUACGUCAGUACCGA").count_degenerate(), 0) self.assertEqual(self.RNA("N").count_degenerate(), 1) self.assertEqual(self.PROT("N").count_degenerate(), 0) self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(seq):\n\treturn sum(1 for x in seq)", "def count():", "def n_neg(seq):\n\n # Convert to all upper case\n seq = seq.upper()\n\n # Check the valiality of sequence\n for aa in seq:\n if aa not in bioinfo_dicts.aa.keys():\n raise RuntimeError(aa + ' is not a valid amino acid...
[ "0.6848711", "0.6295464", "0.6287779", "0.6244194", "0.61932415", "0.6169714", "0.61309725", "0.60558563", "0.6046519", "0.60183054", "0.5953899", "0.5946832", "0.59274083", "0.59274083", "0.59274083", "0.59274083", "0.59089196", "0.58695394", "0.58592194", "0.5851811", "0.58...
0.7551653
0
Sequence possibilities should return correct possible sequences
def test_possibilites(self): self.assertEqual(self.RNA("").possibilities(), 1) self.assertEqual(self.RNA("ACGUgcaucagUCGuGCAU").possibilities(), 1) self.assertEqual(self.RNA("N").possibilities(), 4) self.assertEqual(self.RNA("R").possibilities(), 2) self.assertEqual(self.RNA("H")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_example3():\r\n # example for digits\r\n #outcomes = [0, 1, 2, 3]\r\n #outcomes = set([\"Red\", \"Green\", \"Blue\"])\r\n outcomes = [\"Sunday\", \"Mondy\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]\r\n \r\n length = len(outcomes)\r\n seq_outcomes = gen_permut...
[ "0.6451877", "0.64194185", "0.6369115", "0.63498205", "0.6296486", "0.6141317", "0.6140594", "0.61095506", "0.6094196", "0.601955", "0.60061276", "0.60061276", "0.5983081", "0.5967915", "0.5967915", "0.596747", "0.59457666", "0.5937749", "0.59172374", "0.590627", "0.58843756"...
0.6231163
5
Sequence MW should return correct molecular weight
def test_mw(self): self.assertEqual(self.PROT("").mw(), 0) self.assertEqual(self.RNA("").mw(), 0) self.assertFloatEqual(self.PROT("A").mw(), 89.09) self.assertFloatEqual(self.RNA("A").mw(), 375.17) self.assertFloatEqual(self.PROT("AAA").mw(), 231.27) self.assertFloatEqual...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def molecular_weight(self):\n mw = 0.0\n for a in self.allAtoms:\n try:\n mw += self.atomic_weight[a.element]\n except KeyError as key:\n print(\"Unknown element: %s\" % (key))\n return mw", "def weight(self):", "def calc_weight(sequence)...
[ "0.7027596", "0.6802022", "0.6607669", "0.64320344", "0.6425315", "0.62831134", "0.6272113", "0.626462", "0.6173914", "0.61738116", "0.61569583", "0.6091013", "0.6020042", "0.6001049", "0.59498864", "0.5934019", "0.5934019", "0.5933023", "0.5921253", "0.5921253", "0.589234", ...
0.6155423
11
Sequence can_match should return True if all positions can match
def test_can_match(self): assert self.RNA("").can_match("") assert self.RNA("UCAG").can_match("UCAG") assert not self.RNA("UCAG").can_match("ucag") assert self.RNA("UCAG").can_match("NNNN") assert self.RNA("NNNN").can_match("UCAG") assert self.RNA("NNNN").can_match("NNNN"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match(self) -> bool:", "def matches(self):\n pass", "def matches(self):\n return False", "def has_abba(match_obj):\n\tseq = match_obj.group(0)\n\treturn any(map(lambda x: seq[x] != seq[x + 1] and seq[x + 1] == seq[x + 2] and seq[x] == seq[x + 3], range(len(seq) - 3))) # faster because l...
[ "0.6974837", "0.6763308", "0.6560951", "0.63259244", "0.621092", "0.6178477", "0.6166513", "0.6088974", "0.60831696", "0.6034867", "0.6013674", "0.6004237", "0.5992516", "0.59834796", "0.59807265", "0.5968355", "0.5934371", "0.59324193", "0.5888772", "0.58881915", "0.58878106...
0.56338
40
Sequence can_mismatch should return True on any possible mismatch
def test_can_mismatch(self): assert not self.RNA("").can_mismatch("") assert self.RNA("N").can_mismatch("N") assert self.RNA("R").can_mismatch("R") assert self.RNA("N").can_mismatch("r") assert self.RNA("CGUACGCAN").can_mismatch("CGUACGCAN") assert self.RNA("U").can_misma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_sequence_numbers(self):\n return self.hive_sequence1() == self.hive_sequence2()", "def compatible_sequences(self, seq1, seq2):\n return (len(seq1) == len(seq1)\n and all(self.compatible_elements(e1, e2) for e1, e2 in zip(seq1, seq2)))", "def count_sequence_mismatches(s...
[ "0.72808003", "0.6819058", "0.6590479", "0.64313793", "0.6364049", "0.63189673", "0.6298781", "0.6290321", "0.6250384", "0.6203331", "0.6185142", "0.61535156", "0.6131911", "0.6117184", "0.6106841", "0.6085957", "0.6071501", "0.6070894", "0.6062954", "0.60169154", "0.60099", ...
0.6490159
3
Sequence must_match should return True when no possible mismatches
def test_must_match(self): assert self.RNA("").must_match("") assert not self.RNA("N").must_match("N") assert not self.RNA("R").must_match("R") assert not self.RNA("N").must_match("r") assert not self.RNA("CGUACGCAN").must_match("CGUACGCAN") assert not self.RNA("U").must_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match(self) -> bool:", "def matches(self):\n return False", "def compare_matches(matches, target) -> bool:\n\n for match in target:\n if match not in matches and tuple(reversed(match)) not in matches:\n return False\n return True", "def matches(self):\n pass", ...
[ "0.72805357", "0.70767", "0.6946193", "0.68602705", "0.65113026", "0.6429952", "0.63747734", "0.6360479", "0.6357274", "0.63341963", "0.63246435", "0.6287626", "0.6261958", "0.62513053", "0.62261045", "0.6223343", "0.6190417", "0.6188223", "0.6183464", "0.6182981", "0.6143251...
0.5738524
64
Sequence can_pair should return True if all positions can pair
def test_can_pair(self): assert self.RNA("").can_pair("") assert not self.RNA("UCAG").can_pair("UCAG") assert self.RNA("UCAG").can_pair("CUGA") assert not self.RNA("UCAG").can_pair("cuga") assert self.RNA("UCAG").can_pair("NNNN") assert self.RNA("NNNN").can_pair("UCAG") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_pairing(cls) -> bool:\n return False", "def is_paired_list(self, key):\n if key in ('pattern','points'):\n return True\n else:\n return False", "def check_pairs(self, all_pr, curr):\n flag = True\n for pair_ox in all_pr:\n if (curr[0]...
[ "0.6762524", "0.6758989", "0.67181385", "0.66672415", "0.65605104", "0.6387802", "0.6365733", "0.62890655", "0.6286391", "0.6283751", "0.62820536", "0.62362295", "0.61333513", "0.6126813", "0.6116721", "0.60191566", "0.6006423", "0.5966425", "0.59639806", "0.59168506", "0.589...
0.66616267
4
Sequence can_mispair should return True on any possible mispair
def test_can_mispair(self): assert not self.RNA("").can_mispair("") assert self.RNA("N").can_mispair("N") assert self.RNA("R").can_mispair("Y") assert self.RNA("N").can_mispair("r") assert self.RNA("CGUACGCAN").can_mispair("NUHCHUACH") assert self.RNA("U").can_mispair("C"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_mi():\n pass", "def ok_mm_primer(primer_seq, all_primer_seqs, primer_mm):\r\n for curr_pat in all_primer_seqs:\r\n if count_mismatches(primer_seq, curr_pat, primer_mm) <= primer_mm:\r\n return True\r\n return False", "def check_sat(m):\n conflict = False\n matrix = np.a...
[ "0.5894247", "0.55321866", "0.5423738", "0.532274", "0.52513564", "0.5211209", "0.5125752", "0.50944513", "0.5094062", "0.50700766", "0.50617254", "0.5061186", "0.5042807", "0.5036132", "0.5035601", "0.50216484", "0.50123334", "0.50002867", "0.49906853", "0.4979314", "0.49767...
0.7014911
0
Sequence must_pair should return True when no possible mispairs
def test_must_pair(self): assert self.RNA("").must_pair("") assert not self.RNA("N").must_pair("N") assert not self.RNA("R").must_pair("Y") assert not self.RNA("A").must_pair("A") assert not self.RNA("CGUACGCAN").must_pair("NUGCGUACG") assert not self.RNA("U").must_pair("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_pairing(cls) -> bool:\n return False", "def test_can_pair(self):\n assert self.RNA(\"\").can_pair(\"\")\n assert not self.RNA(\"UCAG\").can_pair(\"UCAG\")\n assert self.RNA(\"UCAG\").can_pair(\"CUGA\")\n assert not self.RNA(\"UCAG\").can_pair(\"cuga\")\n assert ...
[ "0.7317017", "0.6751099", "0.66120136", "0.64646906", "0.6463766", "0.6461888", "0.63059074", "0.63053954", "0.6272074", "0.6253735", "0.6220704", "0.61994374", "0.6165336", "0.60740834", "0.6050706", "0.60397875", "0.59866846", "0.5950847", "0.5943008", "0.59143764", "0.5884...
0.6926781
1
Sequence diff should count 1 for each difference between sequences
def test_diff(self): self.assertEqual(self.RNA("UGCUGCUC").diff(""), 0) self.assertEqual(self.RNA("UGCUGCUC").diff("U"), 0) self.assertEqual(self.RNA("UGCUGCUC").diff("UCCCCCUC"), 3) # case-sensitive! self.assertEqual(self.RNA("AAAAA").diff("CCCCC"), 5) # raises TypeError...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def countingPointMutations(seq1, seq2):\n seqLength = len(list(seq1))\n \n hammingDistance=0;\n for i in range(0,seqLength):\n if list(seq1)[i]!=list(seq2)[i]:\n hammingDistance = hammingDistance+1;\n return hammingDistance", "def transition_transversion_ratio(sequences):\n tr...
[ "0.6738253", "0.6573086", "0.65236634", "0.649877", "0.6496455", "0.64839786", "0.6373743", "0.62676543", "0.6142756", "0.6069561", "0.6005059", "0.59549564", "0.59305257", "0.58770835", "0.5862605", "0.583485", "0.5826151", "0.57998574", "0.5744836", "0.5724404", "0.57210577...
0.5301341
69
Sequence distance should calculate correctly based on function
def test_distance(self): def f(a, b): if a == b: return 0 if (a in "UC" and b in "UC") or (a in "AG" and b in "AG"): return 1 else: return 10 # uses identity function by default self.assertEqual(self.RNA("UGCUG...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pairwise_dist(self,seq1,seq2):\n \n return jf.damerau_levenshtein_distance(str(seq1), str(seq2))", "def calculate_distance(seq1,seq2):\r\n mmcounter = 0 #mismatchcount\r\n seqlen = 0 #sequence length\r\n \r\n #cout the sequence length and mismatches\r\n for i in range(len(seq1)):\r\...
[ "0.69197243", "0.68019587", "0.6721384", "0.6572255", "0.6519014", "0.6341976", "0.6265648", "0.62486774", "0.62103474", "0.62090683", "0.6148", "0.61288637", "0.6098937", "0.60971296", "0.6053616", "0.60522556", "0.6020256", "0.6010592", "0.60040987", "0.60004663", "0.597528...
0.62021434
10
Sequence matrix_distance should look up distances from a matrix
def test_matrix_distance(self): # note that the score matrix must contain 'diagonal' elements m[i][i] # to avoid failure when the sequences match. m = {"U": {"U": 0, "C": 1, "A": 5}, "C": {"C": 0, "A": 2, "G": 4}} self.assertEqual(self.RNA("UUUCCC").matrix_distance("UCACGG", m), 14) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __build_distance_matrix(self):\n for i in range(0, len(self.__corpus)):\n doc_i = self.__corpus[i]\n for j in range(i + 1, len(self.__corpus)):\n doc_j = self.__corpus[j]\n distance = doc_i.calc_distance(doc_j)\n self.__distance_matrix.a...
[ "0.6737727", "0.6700531", "0.65607816", "0.6550453", "0.6502882", "0.6492697", "0.6485367", "0.6467", "0.64162374", "0.6375636", "0.6326314", "0.63200414", "0.63023067", "0.6289097", "0.6281347", "0.62686527", "0.6267945", "0.62410456", "0.6240649", "0.62321705", "0.62179285"...
0.7115163
0
Sequence frac_same should return similarity between sequences
def test_frac_same(self): s1 = self.RNA("ACGU") s2 = self.RNA("AACG") s3 = self.RNA("GG") s4 = self.RNA("A") e = self.RNA("") self.assertEqual(s1.frac_same(e), 0) self.assertEqual(s1.frac_same(s2), 0.25) self.assertEqual(s1.frac_same(s3), 0) self.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_similar(self):\n transitions = dict.fromkeys(\n [\n (\"A\", \"A\"),\n (\"A\", \"G\"),\n (\"G\", \"A\"),\n (\"G\", \"G\"),\n (\"U\", \"U\"),\n (\"U\", \"C\"),\n (\"C\", \"U\"),\n ...
[ "0.7522091", "0.74742055", "0.74742055", "0.6854061", "0.67875874", "0.6664338", "0.6616586", "0.6588712", "0.6554347", "0.64931285", "0.64815015", "0.6379736", "0.6340168", "0.63111854", "0.62825", "0.62772065", "0.62056434", "0.61924475", "0.61527693", "0.6145285", "0.60967...
0.7216408
3
Sequence frac_diff should return difference between sequences
def test_frac_diff(self): s1 = self.RNA("ACGU") s2 = self.RNA("AACG") s3 = self.RNA("GG") s4 = self.RNA("A") e = self.RNA("") self.assertEqual(s1.frac_diff(e), 0) self.assertEqual(s1.frac_diff(s2), 0.75) self.assertEqual(s1.frac_diff(s3), 1) self.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_diffNonGaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"AGGG\")\n s3 = self.RNA(\"GGGG\")\n s4 = self.RNA(\"AG--GA-G\")\n s5 = self.RNA(\"CU--CU-C\")\n s6 = self.RNA(\"AC--GC-G\")\n s7 = self.RNA(\"--------\")\n s8 = self.RNA(\"AAAA----\"...
[ "0.6682282", "0.65871775", "0.6406857", "0.63614774", "0.633233", "0.60608715", "0.5996062", "0.5925066", "0.5844651", "0.58167034", "0.57268333", "0.56967485", "0.56595033", "0.56105644", "0.5590587", "0.5588716", "0.55883276", "0.55557704", "0.554874", "0.5516476", "0.54867...
0.69646966
0
Sequence frac_same_gaps should return similarity in gap positions
def test_frac_same_gaps(self): s1 = self.RNA("AAAA") s2 = self.RNA("GGGG") s3 = self.RNA("----") s4 = self.RNA("A-A-") s5 = self.RNA("-G-G") s6 = self.RNA("UU--") s7 = self.RNA("-") s8 = self.RNA("GGG") e = self.RNA("") self.assertEqual(s1....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_same_non_gaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"AGGG\")\n s3 = self.RNA(\"GGGG\")\n s4 = self.RNA(\"AG--GA-G\")\n s5 = self.RNA(\"CU--CU-C\")\n s6 = self.RNA(\"AC--GC-G\")\n s7 = self.RNA(\"--------\")\n s8 = self.RNA(\"AAAA----...
[ "0.7100668", "0.68241644", "0.6488444", "0.6251183", "0.622191", "0.62168777", "0.6174029", "0.6057268", "0.59166205", "0.58478665", "0.5809226", "0.57599026", "0.57473063", "0.57302", "0.57302", "0.57115066", "0.5697203", "0.5636952", "0.5636567", "0.5633265", "0.56134945", ...
0.73995185
0
Sequence frac_diff_gaps should return difference in gap positions
def test_frac_diffGaps(self): s1 = self.RNA("AAAA") s2 = self.RNA("GGGG") s3 = self.RNA("----") s4 = self.RNA("A-A-") s5 = self.RNA("-G-G") s6 = self.RNA("UU--") s7 = self.RNA("-") s8 = self.RNA("GGG") e = self.RNA("") self.assertEqual(s1.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_diffNonGaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"AGGG\")\n s3 = self.RNA(\"GGGG\")\n s4 = self.RNA(\"AG--GA-G\")\n s5 = self.RNA(\"CU--CU-C\")\n s6 = self.RNA(\"AC--GC-G\")\n s7 = self.RNA(\"--------\")\n s8 = self.RNA(\"AAAA----\"...
[ "0.7225307", "0.67301106", "0.66909367", "0.6637069", "0.63543224", "0.63248473", "0.625972", "0.6218654", "0.621057", "0.61792654", "0.6112803", "0.6037798", "0.5851911", "0.58475983", "0.58424854", "0.5677977", "0.5675696", "0.56663543", "0.5583191", "0.5574306", "0.5514928...
0.73904467
0
Sequence frac_same_non_gaps should return similarities at nongaps
def test_frac_same_non_gaps(self): s1 = self.RNA("AAAA") s2 = self.RNA("AGGG") s3 = self.RNA("GGGG") s4 = self.RNA("AG--GA-G") s5 = self.RNA("CU--CU-C") s6 = self.RNA("AC--GC-G") s7 = self.RNA("--------") s8 = self.RNA("AAAA----") s9 = self.RNA("A-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_same_gaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"GGGG\")\n s3 = self.RNA(\"----\")\n s4 = self.RNA(\"A-A-\")\n s5 = self.RNA(\"-G-G\")\n s6 = self.RNA(\"UU--\")\n s7 = self.RNA(\"-\")\n s8 = self.RNA(\"GGG\")\n e = self.RNA(\"...
[ "0.73611933", "0.6853093", "0.6707912", "0.64544857", "0.61881554", "0.6067325", "0.6048163", "0.59375685", "0.59336567", "0.5676094", "0.55943984", "0.5567829", "0.5493283", "0.5493283", "0.54437655", "0.54295635", "0.54226124", "0.5417089", "0.53966296", "0.53905", "0.53888...
0.7459763
0
Sequence frac_diff_non_gaps should return differences at nongaps
def test_frac_diffNonGaps(self): s1 = self.RNA("AAAA") s2 = self.RNA("AGGG") s3 = self.RNA("GGGG") s4 = self.RNA("AG--GA-G") s5 = self.RNA("CU--CU-C") s6 = self.RNA("AC--GC-G") s7 = self.RNA("--------") s8 = self.RNA("AAAA----") s9 = self.RNA("A-GG...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_diffGaps(self):\n s1 = self.RNA(\"AAAA\")\n s2 = self.RNA(\"GGGG\")\n s3 = self.RNA(\"----\")\n s4 = self.RNA(\"A-A-\")\n s5 = self.RNA(\"-G-G\")\n s6 = self.RNA(\"UU--\")\n s7 = self.RNA(\"-\")\n s8 = self.RNA(\"GGG\")\n e = self.RNA(\"\...
[ "0.7439105", "0.6938618", "0.67893827", "0.6030237", "0.603009", "0.5993497", "0.57819146", "0.57747155", "0.57746786", "0.567172", "0.56545997", "0.5574829", "0.5558459", "0.55300987", "0.5500124", "0.54575205", "0.5447627", "0.5424767", "0.5401605", "0.5380952", "0.5379418"...
0.7880588
0
Sequence frac_similar should return the fraction similarity
def test_frac_similar(self): transitions = dict.fromkeys( [ ("A", "A"), ("A", "G"), ("G", "A"), ("G", "G"), ("U", "U"), ("U", "C"), ("C", "U"), ("C", "C"), ] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_frac_same(self):\n s1 = self.RNA(\"ACGU\")\n s2 = self.RNA(\"AACG\")\n s3 = self.RNA(\"GG\")\n s4 = self.RNA(\"A\")\n e = self.RNA(\"\")\n self.assertEqual(s1.frac_same(e), 0)\n self.assertEqual(s1.frac_same(s2), 0.25)\n self.assertEqual(s1.frac_same...
[ "0.7017269", "0.6662179", "0.6660259", "0.6638686", "0.6638686", "0.6472042", "0.60609144", "0.6037269", "0.60179865", "0.6010803", "0.6006697", "0.58934134", "0.58387834", "0.58198506", "0.5782344", "0.5776492", "0.57633436", "0.57590544", "0.5711294", "0.5676241", "0.565773...
0.79655254
0
with_termini_unknown should reset termini to unknown char
def test_with_termini_unknown(self): s1 = self.RNA("-?--AC--?-") s2 = self.RNA("AC") self.assertEqual(s1.with_termini_unknown(), "????AC????") self.assertEqual(s2.with_termini_unknown(), "AC")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_term_chars_default(self, instrument):\n assert instrument.term_chars == b'\\r'", "def strip_other_charcter():\n pass", "def test_term_chars_default(self, instrument):\n assert instrument.term_chars is None", "def set_terminator (self, term):\r\n self.terminator = term", "de...
[ "0.63693273", "0.63148445", "0.5928961", "0.57174045", "0.55202454", "0.5488006", "0.54239345", "0.53940064", "0.53883356", "0.53773767", "0.5307043", "0.52910495", "0.52059764", "0.5167487", "0.51656246", "0.51492214", "0.51492214", "0.51466554", "0.5135072", "0.5101027", "0...
0.7095066
0
gap degen character should be treated consistently
def test_consistent_gap_degen_handling(self): # the degen character '?' can be a gap, so when we strip either gaps or # degen characters it should be gone too raw_seq = "---??-??TC-GGCG-GCA-G-GC-?-C-TAN-GCGC-CCTC-AGGA?-???-??--" raw_ungapped = re.sub("[-?]", "", raw_seq) raw_no_a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_is_gap(self):\n r = self.RNA(\"ACGUCAGUACGUCAGNRCGAUcaguaguacYRNRYRN\")\n for char in \"qwertyuiopasdfghjklzxcvbnmQWERTYUIOASDFGHJKLZXCVBNM\":\n assert not r.is_gap(char)\n assert r.is_gap(\"-\")\n # only works on a single literal that's a gap, not on a sequence.\n ...
[ "0.69210255", "0.64609724", "0.63262624", "0.63087875", "0.6294152", "0.6294152", "0.6140576", "0.6091902", "0.60851234", "0.5905722", "0.5901116", "0.5892332", "0.5745669", "0.5726817", "0.5707481", "0.5671575", "0.5660184", "0.565967", "0.56095153", "0.5588575", "0.5571344"...
0.7278505
0
replace should convert oldchars to new returning same class
def test_replace(self): seq = self.SEQ("ACC--GT") got = seq.replace("-", "N") self.assertEqual(str(got), "ACCNNGT") self.assertTrue(isinstance(got, self.SEQ))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace(self, old, new) -> String:\n pass", "def str_replace(self):\n return AttributeFunctor(self, str.replace)", "def cleaner(self, w_old):\n w_new = re.sub('[\\(\\)]', '', w_old)\n w_new = re.sub('[^А-Яа-яЁё ]', 'ъ', w_new)\n w_new = re.sub(' ', ' ', w_new)\n retur...
[ "0.6616623", "0.65145993", "0.6462281", "0.63127756", "0.62210834", "0.6133326", "0.60500735", "0.6049743", "0.60426474", "0.6016183", "0.60050994", "0.5990557", "0.5990557", "0.5882208", "0.5830601", "0.5818791", "0.5728969", "0.5707243", "0.56833285", "0.5671954", "0.561641...
0.5719436
17
count motifs of different sizes, +/ ambiguities
def test_counts(self): # test DNA seq orig = "AACCGGTTAN-T" seq = self.DNA(orig) # no gaps, no ambiguities got = seq.counts() expect = dict(A=3, C=2, G=2, T=3) self.assertEqual(dict(got), expect) # gaps allowed got = seq.counts(allow_gap=True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def motif_count(sequences, start_at=4, stop_at=8):\n motifs = dict()\n for motif_length in range(start_at, stop_at):\n motifs[motif_length] = dict()\n for sequence in sequences:\n for motif in possible_motifs_by_length(motif_length):\n if motif not in motifs[motif_leng...
[ "0.6813941", "0.67641443", "0.6477645", "0.6291554", "0.62849253", "0.62556505", "0.61306506", "0.6076058", "0.60514116", "0.6012605", "0.6009881", "0.5953792", "0.59220415", "0.57814854", "0.57814854", "0.57644165", "0.57558626", "0.5755729", "0.57417923", "0.5730251", "0.57...
0.5971249
11
correctly compute test of strand symmetry
def test_strand_symmetry(self): from cogent3 import get_moltype from cogent3.core.alignment import Aligned seq = DnaSequence("ACGGCTGAAGCGCTCCGGGTTTAAAACG") ssym = seq.strand_symmetry(motif_length=1) assert_allclose(ssym.observed.array, [[7, 5], [7, 9]]) assert_allclose(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_SIS():\r\n def is_symmetric_mode(beta, k0, g, a_over_d, h):\r\n \"\"\"\r\n Eq (7i) of paper\r\n beta is what I call kx\r\n k0 is vacuum angular wavenumber\r\n g is thickness of air layer\r\n h is thickness of corrugated layer\r\n a_over_d is the fraction...
[ "0.63519", "0.61964", "0.6154767", "0.6064618", "0.60603386", "0.5892058", "0.5890361", "0.58877325", "0.5883666", "0.58834434", "0.58414036", "0.58307683", "0.58130914", "0.57959944", "0.57908404", "0.5764748", "0.5760158", "0.5756662", "0.5742532", "0.57173836", "0.57108235...
0.5772715
15
DnaSequence should behave as expected
def test_DnaSequence(self): x = DnaSequence("tcag") # note: no longer preserves case self.assertEqual(x, "TCAG") x = DnaSequence("aaa") + DnaSequence("ccc") # note: doesn't preserve case self.assertEqual(x, "AAACCC") assert x.moltype is DNA self.assertRai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ModelDnaCodonSequence(self):\n d = ArrayDnaCodonSequence(\"UUUCGU\")\n self.assertEqual(str(d), \"TTTCGT\")\n self.assertEqual(d._data, array([0, 28]))\n self.assertEqual(str(d.to_rna()), \"UUUCGU\")\n self.assertEqual(str(d.to_dna()), \"TTTCGT\")", "def translate_DNA(...
[ "0.73271704", "0.68954426", "0.6802941", "0.6800046", "0.67086923", "0.6665731", "0.6584737", "0.65618503", "0.6433904", "0.6413777", "0.6383003", "0.6311124", "0.61830586", "0.6149528", "0.61370975", "0.6119347", "0.61098856", "0.61098856", "0.61098856", "0.61098856", "0.610...
0.6965354
1
Sequence to_fasta() should return Fastaformat string
def test_to_fasta(self): even = "TCAGAT" odd = even + "AAA" even_dna = self.SequenceClass(even, name="even") odd_dna = self.SequenceClass(odd, name="odd") self.assertEqual(even_dna.to_fasta(), ">even\nTCAGAT\n") # set line wrap to small number so we can test that it works...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_to_fasta(self):\n even = \"TCAGAT\"\n odd = even + \"AAA\"\n even_dna = self.SEQ(even, name=\"even\")\n odd_dna = self.SEQ(odd, name=\"odd\")\n self.assertEqual(even_dna.to_fasta(), \">even\\nTCAGAT\\n\")\n # set line wrap to small number so we can test that it wo...
[ "0.74317557", "0.7302847", "0.70808065", "0.6741352", "0.67153966", "0.67040503", "0.6695643", "0.66434294", "0.66212684", "0.6602914", "0.6531266", "0.65176135", "0.65008026", "0.6492443", "0.648414", "0.64614666", "0.638201", "0.6333177", "0.6327045", "0.62993723", "0.62658...
0.74931866
0
Sequence to_phylip() should return oneline phylip string
def test_to_phylip(self): s = self.SequenceClass("ACG", name="xyz") self.assertEqual(s.to_phylip(), "xyz" + " " * 27 + "ACG")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _toPhylip(seq, width=None, name=None):\n\n if name is None:\n name = seq.name\n\n output = '%-10s%s' % (name[:10], seq.seq)\n\n if width:\n output = textwrap.fill(output, width)\n\n return output", "def __str__(self):\n A, b = self.A, self.b\n A_rows = str(A).split('\\...
[ "0.67031217", "0.590137", "0.5797911", "0.5694089", "0.56807077", "0.5645143", "0.55652755", "0.556261", "0.5523871", "0.5515493", "0.5506121", "0.550052", "0.5490149", "0.54742414", "0.5463294", "0.5462326", "0.54445654", "0.54246205", "0.5416303", "0.54102886", "0.54089516"...
0.73432875
0
Sequence should do roundtrip from string
def test_init(self): orig = "" r = self.SequenceClass(orig) self.assertEqual(str(r), orig) orig = "TCAGGA" r = self.SequenceClass(orig) self.assertEqual(r._data, array([0, 1, 2, 3, 3, 2])) self.assertEqual(str(r), orig)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init(self):\n orig = \"TC---\"\n seq = self.SequenceClass(orig)\n self.assertEqual(str(seq), orig)", "def test_arg_seqsetReturnsRest(self):\n sequence = b\"1:* blah blah blah\"\n _, rest = self.server.arg_seqset(sequence)\n self.assertEqual(rest, b\"blah blah bl...
[ "0.61597615", "0.59448475", "0.59101284", "0.590903", "0.5804569", "0.58039635", "0.5787849", "0.57741314", "0.57418114", "0.5736445", "0.5736445", "0.5656105", "0.5616584", "0.5574958", "0.55397314", "0.5536651", "0.5533705", "0.55186754", "0.55147666", "0.55138576", "0.5493...
0.5789307
6
Sequence should do roundtrip from string
def test_init(self): orig = "" r = self.SequenceClass(orig) self.assertEqual(str(r), orig) orig = "TCAGGA" r = self.SequenceClass(orig) self.assertEqual(r._data, array([6, 62])) self.assertEqual(str(r), orig)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init(self):\n orig = \"TC---\"\n seq = self.SequenceClass(orig)\n self.assertEqual(str(seq), orig)", "def test_arg_seqsetReturnsRest(self):\n sequence = b\"1:* blah blah blah\"\n _, rest = self.server.arg_seqset(sequence)\n self.assertEqual(rest, b\"blah blah bl...
[ "0.61597615", "0.59448475", "0.59101284", "0.590903", "0.5804569", "0.58039635", "0.5789307", "0.5787849", "0.57741314", "0.5736445", "0.5736445", "0.5656105", "0.5616584", "0.5574958", "0.55397314", "0.5536651", "0.5533705", "0.55186754", "0.55147666", "0.55138576", "0.54939...
0.57418114
9
gapped sequence should init ok
def test_init(self): orig = "TC---" seq = self.SequenceClass(orig) self.assertEqual(str(seq), orig)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n self.sequence = []", "def _setup_next_sequence(cls):\n return 0", "def __init__(self, name, seq):", "def sequence_params(self):", "def test_init_other_seq(self):\n r = self.RNA(\"UCAGG\", name=\"x\", info={\"z\": 3})\n s = Sequence(r)\n self.assert...
[ "0.7444208", "0.7348284", "0.6941958", "0.67654663", "0.65011185", "0.64981246", "0.6471606", "0.64708334", "0.64288723", "0.6352727", "0.63433516", "0.63378966", "0.63378966", "0.6330547", "0.6268885", "0.6231691", "0.6231691", "0.6231691", "0.6231691", "0.62212265", "0.6207...
0.6633261
4
gapped sequence gaps() should return correct array
def test_gaps(self): sc = self.SequenceClass self.assertEqual(sc("TC").gaps(), array([0, 0])) self.assertEqual(sc("T-").gaps(), array([0, 1]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_gaps( rows ):\n\n n = len(rows) - 1\n gaps = [ rows[i+1][0]-rows[i][1] for i in range(n) ]\n return gaps", "def gaps(self):\n return self.gaps_L + self.gaps_R", "def gaps(df):\n return [(round(df[i][\"o\"] - df[i - 1][\"c\"], 2)) for i in range(1, len(df))]", "def test_insert_gaps_orde...
[ "0.78606015", "0.7746227", "0.67420995", "0.66259617", "0.6539372", "0.6508552", "0.6438995", "0.64207256", "0.6336118", "0.62919784", "0.6123557", "0.6101051", "0.59396046", "0.5879722", "0.5850899", "0.58267665", "0.58036804", "0.5785935", "0.5767074", "0.57385033", "0.5681...
0.6996217
2
gapped sequence degap() should return correct array
def test_degap(self): sc = self.SequenceClass self.assertEqual(sc("T-").degap(), sc("T"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_4s_every_other_in_between(seq):\n seq_copy = seq [4:-4:2]\n return seq_copy", "def test_gap_array(self):\n r = self.RNA(\"-?A-?NRY-\")\n v = r.gap_array()\n self.assertEqual(v, array([1, 1, 0, 1, 1, 0, 0, 0, 1]))\n r = self.RNA(\"AC\")\n v = r.gap_array()\n ...
[ "0.6390187", "0.6190564", "0.61109865", "0.6049955", "0.602145", "0.599215", "0.59646714", "0.59629524", "0.5829033", "0.5804169", "0.571457", "0.5707399", "0.5704853", "0.5597642", "0.55599564", "0.55588984", "0.5544854", "0.54950273", "0.5490978", "0.54840785", "0.5462475",...
0.525362
46
gapped sequence nongaps() should return correct array
def test_nongaps(self): sc = self.SequenceClass self.assertEqual(sc("TC").nongaps(), array([1, 1])) self.assertEqual(sc("T-").nongaps(), array([1, 0]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gaps(self):\n sc = self.SequenceClass\n self.assertEqual(sc(\"TC\").gaps(), array([0, 0]))\n self.assertEqual(sc(\"T-\").gaps(), array([0, 1]))", "def findGaps(sequence):\n patt = re.compile(r\"[Nn]+\")\n for match in patt.finditer(sequence):\n yield (match.start(), mat...
[ "0.61690015", "0.6166339", "0.5894974", "0.58692527", "0.58428276", "0.57104343", "0.5640709", "0.554734", "0.5539277", "0.55391294", "0.55129206", "0.5431471", "0.5401227", "0.5352029", "0.53116506", "0.5305194", "0.5293791", "0.5287529", "0.5271896", "0.5259445", "0.5253917...
0.7228265
0
gapped sequence regap() should return correct sequence
def test_regap(self): sc = self.SequenceClass self.assertEqual(str(sc("TC").regap(sc("A---A-"))), "T---C-")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_gaps(self):\n sc = self.SequenceClass\n self.assertEqual(sc(\"TC\").gaps(), array([0, 0]))\n self.assertEqual(sc(\"T-\").gaps(), array([0, 1]))", "def group(seq):\n pass # replace with your solution", "def check_gapped(sequence):\n w_regexp = re.compile('n|N')\n regexp_ob...
[ "0.61801946", "0.6072817", "0.5821261", "0.57876194", "0.5663991", "0.5558589", "0.55302256", "0.55173", "0.5506784", "0.5503168", "0.54316753", "0.53699327", "0.5357166", "0.5355198", "0.53514254", "0.5329967", "0.53242975", "0.5302287", "0.52581125", "0.52402294", "0.522924...
0.6927464
0
Regular sequence should convert to model sequence
def test_regular_to_model(self): r = RNA.make_seq("AAA", name="x") s = RNA.make_array_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_model_to_regular(self):\n r = RNA.make_array_seq(\"AAA\", name=\"x\")\n s = RNA.make_seq(r)\n self.assertEqual(str(s), \"AAA\")\n self.assertEqual(s.moltype, RNA)\n self.assertEqual(s.name, \"x\")", "def test_model_to_model(self):\n r = RNA.make_array_seq(\"AAA\...
[ "0.732975", "0.70638686", "0.6560123", "0.65202504", "0.628081", "0.6274271", "0.62084633", "0.617465", "0.59855276", "0.58972305", "0.5821316", "0.58064896", "0.57611835", "0.5760904", "0.57509965", "0.5748884", "0.5734916", "0.5701258", "0.56332576", "0.5625062", "0.5587976...
0.74114156
0
Model sequence should convert to regular sequence
def test_model_to_regular(self): r = RNA.make_array_seq("AAA", name="x") s = RNA.make_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_regular_to_model(self):\n r = RNA.make_seq(\"AAA\", name=\"x\")\n s = RNA.make_array_seq(r)\n self.assertEqual(str(s), \"AAA\")\n self.assertEqual(s.moltype, RNA)\n self.assertEqual(s.name, \"x\")", "def test_model_to_model(self):\n r = RNA.make_array_seq(\"AAA\...
[ "0.6850945", "0.66729575", "0.6485937", "0.6349795", "0.6317251", "0.61167735", "0.60555464", "0.6052192", "0.5994143", "0.5922497", "0.59025365", "0.58883065", "0.58029574", "0.5746057", "0.5729786", "0.57184625", "0.5694364", "0.5694364", "0.5694364", "0.5694364", "0.569436...
0.6829134
1
Regular sequence should convert to regular sequence
def test_regular_to_regular(self): r = RNA.make_seq("AAA", name="x") s = RNA.make_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(self, seq):", "def test_model_to_regular(self):\n r = RNA.make_array_seq(\"AAA\", name=\"x\")\n s = RNA.make_seq(r)\n self.assertEqual(str(s), \"AAA\")\n self.assertEqual(s.moltype, RNA)\n self.assertEqual(s.name, \"x\")", "def test_regular_to_model(self):\n ...
[ "0.6617936", "0.6383945", "0.6319407", "0.62932134", "0.62242186", "0.6218362", "0.61613417", "0.61074924", "0.60580015", "0.5998588", "0.5887306", "0.586777", "0.58568335", "0.5827881", "0.57606894", "0.5693285", "0.56801903", "0.56508076", "0.5638858", "0.56294554", "0.5623...
0.6652918
0
Model sequence should convert to model sequence
def test_model_to_model(self): r = RNA.make_array_seq("AAA", name="x") s = RNA.make_array_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_regular_to_model(self):\n r = RNA.make_seq(\"AAA\", name=\"x\")\n s = RNA.make_array_seq(r)\n self.assertEqual(str(s), \"AAA\")\n self.assertEqual(s.moltype, RNA)\n self.assertEqual(s.name, \"x\")", "def test_model_to_regular(self):\n r = RNA.make_array_seq(\"AA...
[ "0.6928161", "0.6812833", "0.65000093", "0.60420865", "0.60281956", "0.59811866", "0.5976736", "0.58936715", "0.5847981", "0.5823246", "0.5763527", "0.57178855", "0.5535258", "0.55170923", "0.54954267", "0.548045", "0.5480217", "0.5442175", "0.54339", "0.54253", "0.54149", ...
0.7089526
0
ArrayDnaCodonSequence should behave as expected
def test_ModelDnaCodonSequence(self): d = ArrayDnaCodonSequence("UUUCGU") self.assertEqual(str(d), "TTTCGT") self.assertEqual(d._data, array([0, 28])) self.assertEqual(str(d.to_rna()), "UUUCGU") self.assertEqual(str(d.to_dna()), "TTTCGT")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ModelRnaCodonSequence(self):\n r = ArrayRnaCodonSequence(\"UUUCGU\")\n self.assertEqual(str(r), \"UUUCGU\")\n self.assertEqual(r._data, array([0, 28]))\n self.assertEqual(str(r.to_rna()), \"UUUCGU\")\n self.assertEqual(str(r.to_dna()), \"TTTCGT\")", "def initialize_dna...
[ "0.7328825", "0.64691025", "0.64041036", "0.6317699", "0.6250591", "0.6247037", "0.62177837", "0.610478", "0.6104387", "0.6039625", "0.6023548", "0.6010523", "0.6005684", "0.600158", "0.59115016", "0.5885456", "0.5826384", "0.5823113", "0.58168215", "0.5790888", "0.57801914",...
0.8081281
0