How to use openen method in SeleniumBase

Best Python code snippet using SeleniumBase

openen.py

Source:openen.py Github

copy

Full Screen

...120 fasta_df.set_index('Accession',inplace=True)121 fasta_df = fasta_df[fasta_df.Sequence != '']122 final_df = fasta_df.dropna()123 return final_df124def openen(W, u, seq):125 w_par = '-W ' + str(W)126 u_par = '-u ' + str(u)127 run(['RNAplfold', w_par, u_par, '-O'], input=str.encode(seq))128def parse_openen(l, n, i, f):129 d = pd.read_csv(f, sep='\t', skiprows=2, header=None)[l][n+i-1]130 return f.replace('_openen',''), d131def stack_openen(n, t, f):132 seqname = f.replace('_openen', '').split()133 seqname = pd.DataFrame(seqname)134 seqname.columns = ['id']135 d = pd.read_csv(f, sep='\t', skiprows=2, nrows=(n+t), header=None) #read in 5UTR length + t lines136 d = d.set_index(0).stack().to_frame()137 d = d[0].apply(lambda x: round(x, 4)).to_list()138 d = pd.DataFrame(d).T139 d = pd.concat([seqname,d], axis=1)140 return d141 142def main():143 base,ext = os.path.splitext(s)144 if ext.lower() in ('.fasta', '.fa', '.fas', '.fna'):145 seq = fasta_to_dataframe(s).reset_index()146 else:147 seq = pd.read_csv(s)148 seq.columns = ['Accession','Sequence']149 seq['Accession'] = '>' + seq['Accession']150 startTime = datetime.now()151 label = (z for z in cycle(list(range(0,p))))152 label = pd.DataFrame({'label': list(islice(label, len(seq)))})153 df = pd.concat([label, seq], axis=1)154 _openen = (df['Accession'].str.replace('>', '') + '_openen').tolist()155 if x is True:156 print('\nRunning RNAplfold using', p, 'processes...')157 print_time()158 159 if U is None:160 utr = 'GGGGAATTGTGAGCGGATAACAATTCCCCTCTAGAAATAATTTTGTTTAACTTTAAGAAGGAGATATACAT'161 df['fasta'] = df['Accession'] + '\n' + utr + seq['Sequence'] + '\n'162 fasta = df.groupby('label')['fasta'].apply(''.join).tolist()163 else:164 try:165 int(U)166 df['fasta'] = df['Accession'] + '\n' + seq['Sequence'] + '\n'167 fasta = df.groupby('label')['fasta'].apply(''.join).tolist()168 except ValueError: 169 df['fasta'] = df['Accession'] + '\n' + U + seq['Sequence'] + '\n'170 fasta = df.groupby('label')['fasta'].apply(''.join).tolist()171 172 groups = len(fasta)173 p1 = Pool(p)174 results = []175 progress(0, groups)176 openen_func = partial(openen, W, u)177 for a in p1.imap_unordered(openen_func, fasta):178 results.append(a)179 progress(len(results), groups)180 181 _stop_timer.set()182 p1.close()183 p1.join() 184 185 else:186 print('\nSkipped RNAplfold (no option -x given!)', flush = True) 187 if S is True:188 print('\nStacking _openen files and merging')189 print_time()190 191 d = pd.DataFrame()192 progress(0, len(_openen))193 for b in _openen:194 d = pd.concat([d, stack_openen(n, t, b)], sort=True)195 progress(len(d), len(_openen))196 197 _stop_timer.set()198 filename = o + '.pkl'199 d.to_pickle(filename)200 201 else:202 print('\nSkipped stacking (no option -S given!)', flush = True)203 if e is True:204 print('\nParsing _openen files using', p, 'processes...')205 parse_func = partial(parse_openen, l, n, i)206 p2 = Pool(p)207 plfold = p2.imap_unordered(parse_func, _openen)208 p2.close()...

Full Screen

Full Screen

parelassistantding.py

Source:parelassistantding.py Github

copy

Full Screen

2import openeentranslate3import openlandcode4import commands5import ai.main6taal = openlandcode.openen()7print(openeentranslate.openen("nl", "upcheck"))8os.system("curl https://raw.githubusercontent.com/Abelkrijgtalles/parel-assistant/master/config/versie.txt > config/versieonline.txt")9with open(os.path.join("config", "versieonline.txt")) as versieonlinenietint:10 versieonline = int(versieonlinenietint.read())11with open(os.path.join("config", "versie.txt")) as versienietint:12 versie = int(versienietint.read())13if versieonline > versie:14 print(openeentranslate.openen(taal, "updateinstall"), "J/N")15 updateinstall = input()16 updateinstall = updateinstall.upper()17 updateinstall = updateinstall.replace(" ", "")18 if updateinstall == "J":19 print(openeentranslate.openen(taal, "isgit"), "J/N")20 isgit = input()21 isgit = isgit.upper()22 isgit = isgit.replace(" ", "")23 if isgit == "J":24 os.system("git pull")25# Wat te doen26# 4: Gui maken (MOEILIJK!!!!!!!!! en het moet wel mooi zijn)27naamgui = ""28while True:29 print(openeentranslate.openen(taal, "wat"))30 naamgui = input()31 naamgui = ai.main.main(naamgui)32 if naamgui == "SONGTEKSTEN":33 print(naamgui, openeentranslate.openen(taal, "open"))34 commands.songteksten.main()35 elif naamgui == "DATA":36 print(naamgui, openeentranslate.openen(taal, "open"))37 commands.data.main()38 elif naamgui == "FEITEN":39 print(naamgui, openeentranslate.openen(taal, "open"))40 commands.feiten.main()41 elif naamgui == "GILLEN":42 print(naamgui, openeentranslate.openen(taal, "open"))43 commands.gillen.main()44 elif naamgui == "LANDEN":45 print(naamgui, openeentranslate.openen(taal, "open"))46 commands.landen.main()47 elif naamgui == "PAASDAG":48 print(naamgui, openeentranslate.openen(taal, "open"))49 commands.paasdag.main()50 elif naamgui == "TEKENCORONA":51 print(naamgui, openeentranslate.openen(taal, "open"))52 commands.tekencorona.main()53 elif naamgui == "STOP":54 break55 elif naamgui == "NIKS":56 print(openeentranslate.openen(taal, "niks"))57 else:58 print(openeentranslate.openen(taal, "niks"))...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run SeleniumBase automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful