def test_compare_template_id(): template_id_1 = TemplateID('2ypd', 'A') template_id_2 = TemplateID('2ypd', 'A') template_id_3 = TemplateID('2ypd', 'B') eq_(template_id_1, template_id_2) ok_(template_id_1 != template_id_3) ok_(not (template_id_1 != template_id_2))
def test_generate_error_archive(): sequence = "EDFPRFPHRGLLLDTSRHYLPLSSILDTLDVMAYNKLNVFHWH" alignment = DomainAlignment(sequence, sequence, SequenceRange(0, len(sequence), sequence), TemplateID('2GK1', 'I')) class _FakeYasara: def CD(self, work_dir): self.work_dir = work_dir def Processors(self, n): pass def ExperimentHomologyModeling(self, *args, **kwargs): error_path = os.path.join(self.work_dir, 'errorexit.txt') with open(error_path, 'w') as f: f.write('10$ reward for reporting') def Experiment(self, s): pass def Wait(self, s): pass def SaveSce(self, filename): pass class FakeContext: def __init__(self): self.target_species_id = 'HUMAN' self.main_target_chain_id = 'I' self.template_pdbid = '2GK1' self.yasara = _FakeYasara() self.template_obj = 1 def get_main_target_sequence(self): return sequence def get_chain_ids(self): return ['I'] def get_sequence(self, chain_id): return sequence context = _FakeContext() try: modeler._model_run(alignment, {'I': alignment}, context) except ModelRunError: pass tar_path = model_storage.get_error_tar_path(context.get_main_target_sequence(), context.target_species_id, alignment, TemplateID(context.template_pdbid, context.main_target_chain_id)) ok_(os.path.isfile(tar_path))
def test_coagulation_factor_v(): seq = "MFPGCPRLWVLVVLGTSWVGWGSQGTEAAQLRQFYVAAQGISWSYRPEPTNSSLNLSVTSFKKIVYREYEPYFKKEKPQSTISGLLGPTLYAEVGDIIKVHFKNKADKPLSIHPQGIRYSKLSEGASYLDHTFPAEKMDDAVAPGREYTYEWSISEDSGPTHDDPPCLTHIYYSHENLIEDFNSGLIGPLLICKKGTLTEGGTQKTFDKQIVLLFAVFDESKSWSQSSSLMYTVNGYVNGTMPDITVCAHDHISWHLLGMSSGPELFSIHFNGQVLEQNHHKVSAITLVSATSTTANMTVGPEGKWIISSLTPKHLQAGMQAYIDIKNCPKKTRNLKKITREQRRHMKRWEY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QVTLSPDISDTTLLPDLSQISPPPDLDQIFYPSESSQSLLLQEFNESFPYPDLGQMPSPSSPTLNDTFLSKEFNPLVIVGLSKDGTDYIEIIPKEEVQSSEDDYAEIDYVPYDDPYKTDVRTNINSSRDPDNIAAWYLRSNNGNRRNYYIAAEEISWDYSEFVQRETDIEDSDDIPEDTTYKKVVFRKYLDSTFTKRDPRGEYEEHLGILGPIIRAEVDDVIQVRFKNLASRPYSLHAHGLSYEKSSEGKTYEDDSPEWFKEDNAVQPNSSYTYVWHATERSGPESPGSACRAWAYYSAVNPEKDIHSGLIGPLLICQKGILHKDSNMPMDMREFVLLFMTFDEKKSWYYEKKSRSSWRLTSSEMKKSHEFHAINGMIYSLPGLKMYEQEWVRLHLLNIGGSQDIHVVHFHGQTLLENGNKQHQLGVWPLLPGSFKTLEMKASKPGWWLLNTEVGENQRAGMQTPFLIMDRDCRMPMGLSTGIISDSQIKASEFLGYWEPRLARLNNGGSYNAWSVEKLAAEFASKPWIQVDMQKEVIITGIQTQGAKHYLKSCYTTEFYVAYSSNQINWQIFKGNSTRNVMYFNGNSDASTIKENQFDPPIVARYIRISPTRAYNRPTLRLELQGCEVNGCSTPLGMENGKIENKQITASSFKKSWWGDYWEPFRARLNAQGRVNAWQAKANNNKQWLEIDLLKIKKITAIITQGCKSLSSEMYVKSYTIHYSEQGVEWKPYRLKSSMVDKIFEGNTNTKGHVKNFFNPPIISRFIRVIPKTWNQSIALRLELFGCDIY" alignments = domain_aligner.get_domain_alignments(seq, require_resnum=534, template_id=TemplateID( '2R7E', 'A'))
def _validate_input_data(form): if 'sequence' not in form: raise ValueError("Missing sequence input") elif not is_protein_sequence(form['sequence']): raise ValueError("Invalid sequence data") sequence = form['sequence'].upper() if 'species_id' not in form: raise ValueError("Missing species_id input") elif not form['species_id'].isalpha(): raise ValueError("Invalid species_id data") species_id = form['species_id'] if 'position' in form: position = int(form['position']) if position < 1 or position > len(sequence): raise ValueError("Residue position out of range") else: position = None if 'template_id' in form: if not _P_TEMPLATE_ID.match(form['template_id']): raise ValueError("Invalid template id data") pdbid, chain_id = form['template_id'].split('_') template_id = TemplateID(pdbid, chain_id) else: template_id = None return sequence, species_id, position, template_id
def test_create_model_5GJV(): from hommod.tasks import create_model path = create_model( "MEPSSPQDEGLRKKQPKKPVPEILPRPPRALFCLTLENPLRKACISIVEWKPFETIILLTIFANCVALAVYL" + "PMPEDDNNSLNLGLEKLEYFFLIVFSIEAAMKIIAYGFLFHQDAYLRSGWNVLDFTIVFLGVFTVILEQVNV" + "IQSHTAPMSSKGAGLDVKALRAFRVLRPLRLVSGVPSLQVVLNSIFKAMLPLFHIALLVLFMVIIYAIIGLE" + "LFKGKMHKTCYFIGTDIVATVENEEPSPCARTGSGRRCTINGSECRGGWPGPNHGITHFDNFGFSMLTVYQC" + "ITMEGWTDVLYWVNDAIGNEWPWIYFVTLILLGSFFILNLVLGVLSGEFTKEREKAKSRGTFQKLREKQQLD" + "EDLRGYMSWITQGEVMDVEDFREGKLSLDEGGSDTESLYEIAGLNKIIQFIRHWRQWNRIFRWKCHDIVKSK" + "VFYWLVILIVALNTLSIASEHHNQPLWLTRLQDIANRVLLSLFTTEMLMKMYGLGLRQYFMSIFNRFDCFVV" + "CSGILEILLVESGAMTPLGISVLRCIRLLRIFKITKYWTSLSNLVASLLNSIRSIASLLLLLFLFIVIFALL" + "GMQLFGGRYDFEDTEVRRSNFDNFPQALISVFQVLTGEDWTSMMYNGIMAYGGPSYPGMLVCIYFIILFVCG" + "NYILLNVFLAIAVDNLAEAESLTSAQKAKAEEKKRRKMSKGLPDKSEEEKSTMAKKLEQKPKGEGIPTTAKL" + "KIDEFESNVNEVKDPYPSADFPGDDEEDEPEIPLSPRPRPLAELQLKEKAVPIPEASSFFIFSPTNKIRVLC" + "HRIVNATWFTNFILLFILLSSAALAAEDPIRADSMRNQILKHFDIGFTSVFTVEIVLKMTTYGAFLHKGSFC" + "RNYFNMLDLLVVAVSLISMGLESSAISVVKILRVLRVLRPLRAINRAKGLKHVVQCMFVAISTIGNIVLVTT" + "LLQFMFACIGVQLFKGKFFRCTDLSKMTEEECRGYYYVYKDGDPMQIELRHREWVHSDFHFDNVLSAMMSLF" + "TVSTFEGWPQLLYKAIDSNAEDVGPIYNNRVEMAIFFIIYIILIAFFMMNIFVGFVIVTFQEQGETEYKNCE" + "LDKNQRQCVQYALKARPLRCYIPKNPYQYQVWYIVTSSYFEYLMFALIMLNTICLGMQHYNQSEQMNHISDI" + "LNVAFTIIFTLEMILKLMAFKARGYFGDPWNVFDFLIVIGSIIDVILSEIDTFLASSGGLYCLGGGCGNVDP" + "DESARISSAFFRLFRVMRLIKLLSRAEGVRTLLWTFIKSFQALPYVALLIVMLFFIYAVIGMQMFGKIALVD" + "GTQINRNNNFQTFPQAVLLLFRCATGEAWQEILLACSYGKLCDPESDYAPGEEYTCGTNFAYYYFISFYMLC" + "AFLVINLFVAVIMDNFDYLTRDWSILGPHHLDEFKAIWAEYDPEAKGRIKHLDVVTLLRRIQPPLGFGKFCP" + "HRVACKRLVGMNMPLNSDGTVTFNATLFALVRTALKIKTEGNFEQANEELRAIIKKIWKRTSMKLLDQVIPP" + "IGDDEVTVGKFYATFLIQEHFRKFMKRQEEYYGYRPKKDIVQIQAGLRTIEEEAAPEICRTVSGDLAAEEEL" + "ERAMVEAAMEEGIFRRTGGLFGQVDNFLERTNSLPPVMANQRPLQFAEIEMEEMESPVFLEDFPQDPRTNPL" + "ARANTNNANANVAYGNSNHSNSHVFSSVHYEREFPEETETPATRGRALGQPCRVLGPHSKPCVEMLKGLLTQ" + "RAMPRGQAPPAPCQCPRVESSMPEDRKSSTPGSLHEETPHSRSTRENTSRCSAPATALLIQKALVRGGLGTL" + "AADANFIMATGQALADACQMEPEEVEIMATELLKGREAPEGMASSLGCLNLGSSLGSLDQHQGSQETLIPPR", "HUMAN", 434, TemplateID('5GJV', 'A')) ok_(path is not None)
def test_create_model_neurexin(): from hommod.tasks import create_model path = create_model( "MWLLALCLVGLAGAQRGGGGPGGGAPGGPGLGLGSLGEERFPVVNTAYGRVRGVRRELNNEILGPVVQFLGVPYATPPLGARRFQPPEAPASWPGVRNATTLPPACPQNLHGALPAIMLPVWFTDNLEAAATYVQNQSEDCLYLNLYVPTEDGPLTKKRDEATLNPPDTDIRDPGKKPVMLFLHGGSYMEGTGNMFDGSVLAAYGNVIVATLNYRLGVLGFLSTGDQAAKGNYGLLDQIQALRWLSENIAHFGGDPERITIFGSGAGASCVNLLILSHHSEGLFQKAIAQSGTAISSWSVNYQPLKYTRLLAAKVGCDREDSAEAVECLRRKPSRELVDQDVQPARYHIAFGPVVDGDVVPDDPEILMQQGEFLNYDMLIGVNQGEGLKFVEDSAESEDGVSASAFDFTVSNFVDNLYGYPEGKDVLRETIKFMYTDWADRDNGEMRRKTLLALFTDHQWVAPAVATAKLHADYQSPVYFYTFYHHCQAEGRPEWADAAHGDELPYVFGVPMVGATDLFPCNFSKNDVMLSAVVMTYWTNFAKTGDPNQPVPQDTKFIHTKPNRFEEVVWSKFNSKEKQYLHIGLKPRVRDNYRANKVAFWLELVPHLHNLHTELFTTTTRLPPYATRWPPRPPAGAPGTRRPPPPATLPPEPEPEPGPRAYDRFPGDSRDYSTELSVTVAVGASLLFLNILAFAALYYKRDRRQELRCRRLSPPGGSGSGVPGGGPLLPAAGRELPPEEELVSLQLKRGGGVGADPAEALRPACPPDYTLALRRAPDDVPLLAPGALTLLPSGLGPPPPPPPPSLHPFGPFPPPPPTATSHNNTLPHPHSTTRV", "HUMAN", 81, TemplateID('3vkf', 'A')) ok_(path is not None)
def test_no_alignment_flip(): seq = ( "MGKLVALVLLGVGLSLVGEMFLAFRERVNASREVEPVEPENCHLIEELESGSEDIDILPSGLAFISSGLKYP" + "GMPNFAPDEPGKIFLMDLNEQNPRAQALEISGGFDKELFNPHGISIFIDKDNTVYLYVVNHPHMKSTVEIFK" + "FEEQQRSLVYLKTIKHELLKSVNDIVVLGPEQFYATRDHYFTNSLLSFFEMILDLRWTYVLFYSPREVKVVA" + "KGFCSANGITVSADQKYVYVADVAAKNIHIMEKHDNWDLTQLKVIQLGTLVDNLTVDPATGDILAGCHPNPM" + "KLLNYNPEDPPGSEVLRIQNVLSEKPRVSTVYANNGSVLQGTSVASVYHGKILIGTVFHKTLYCEL") species_id = 'human' range_ = SequenceRange(183, 265, seq) template_id = TemplateID('4zrn', 'A') alignment = DomainAlignment( "YFTNSLLSFFEMILDLRWT---YVLFYSPRE-----VKVVA---KGFCSANGITVSAD-Q--K-YVYVADVAAKNIHIMEKHDNWDLTQLKVIQLGT", "YSTEMYLEFFAREYGLKYTVLRYANVYGPRQDPYGEAGVVAIFTERMLRGEEVHIFGDGEYVRDYVYVDDVVRANLLAMEKGDN------EVFNIGT", range_, template_id) context = modeler._prepare_context(alignment.template_id.pdbid) context.set_main_target(seq, species_id, alignment.template_id.chain_id) chain_alignments = modeler._make_alignments(seq, species_id, alignment, context, None) for chain_id in chain_alignments: _log.debug("got alignment {}: {}".format(chain_id, chain_alignments[chain_id])) ok_(chain_alignments[chain_id].target_alignment.replace('-','') in seq)
def test_2ypd_A(): seq = ("MADAAASPVGKRLLLLFADTAASASASAPAAAAASGDPGPALRTRAWRAGTVRAMSGAVPQDLA" + "IFVEFDGCNWKQHSWVKVHAEEVIVLLLEGSLVWAPREDPVLLQGIRVSIAQWPALTFTPLVDK" + "LGLGSVVPVEYLLDRELRFLSDANGLHLFQMGTDSQNQILLEHAALRETVNALISDQKLQEIFS" + "RGPYSVQGHRVKIYQPEGEEGWLYGVVSHQDSITRLMEVSVTESGEIKSVDPRLIHVMLMDNST" + "PQSEGGTLKAVKSSKGKKKRESIEGKDGRRRKSASDSGCDPASKKLKGDRGEVDSNGSDGGEAS" + "RGPWKGGNASGEPGLDQRAKQPPSTFVPQINRNIRFATYTKENGRTLVVQDEPVGGDTPASFTP" + "YSTATGQTPLAPEVGGAENKEAGKTLEQVGQGIVASAAVVTTASSTPNTVRISDTGLAAGTVPE" + "KQKGSRSQASGENSRNSILASSGFGAPLPSSSQPL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RLNLASRLPSYFVRPDL" + "GPKMYNAYGLITAEDRRVGTTNLHLDVSDAVNVMVYVGIPIGEGAHDEEVLKTIDEGDADEVTK" + "QRIHDGKEKPGALWHIYAAKDAEKIRELLRKVGEEQGQENPPDHDPIHDQSWYLDQTLRKRLYE" + "EYGVQGWAIVQFLGDAVFIPAGAPHQVHNLYSCIKVAEDFVSPEHVKHCFRLTQEFRHLSNTHT" + "NHEDKLQVKNIIYHAVKDAVGTLKAHESKLARS") template_id = TemplateID('2YPD', 'A') alignments = domain_aligner.get_domain_alignments(seq, template_id=template_id) ok_(alignments[0].range.get_length() <= len(seq))
def test_create_model_gprotein(): from hommod.tasks import create_model path = create_model( "MTLESIMACCLSEEAKEARRINDEIERQLRRDKRDARRELKLLLLGTGESGKSTFIKQMRIIHGSGYSDEDKRGFTKLVYQNIFTAMQAMIRAMDTLKIPYKYEHNKAHAQLVREVDVEKVSAFENPYVDAIKSLWNDPGIQECYDRRREYQLSDSTKYYLNDLDRVADPAYLPTQQDVLRVRVPTTGIIEYPFDLQSVIFRMVDVGGQRSERRKWIHCFENVTSIMFLVALSEYDQVLVESDNENRMEESKALFRTIITYPWFQNSSVILFLNKKDLLEEKIMYSHLVDYFPEYDGPQRDAQAAREFILKMFVDLNPDSDKIIYSHFTCATDTENIRFVFAAVKDTILQLNLKEYNLV", 'HUMAN', 209, TemplateID('3AH8', 'A')) ok_(path is None)
def _get_hits(self, range_, template_id): if self.template_blast_databank is None: raise InitError("blast databank is not set") blast_hits = blaster.blastp(range_.get_sub_sequence(), self.template_blast_databank) _log.debug("{} blast hits to filter".format(len(blast_hits))) good_hits = [] for hit_id in blast_hits: for alignment in blast_hits[hit_id]: # Must shift the numbers in the blast hit, # since we used a sub-sequence. alignment.query_shift_right(range_.start) alignment.full_query_sequence = range_.sequence hit_template_id = TemplateID( alignment.get_hit_accession_code(), alignment.get_hit_chain_id()) if template_id is not None and hit_template_id != template_id: continue if template_id is None and blacklister.is_blacklisted( alignment.get_hit_accession_code()): continue if not dssp.has_secondary_structure(hit_template_id): continue if alignment.get_percentage_identity() >= get_min_identity( alignment.count_aligned_residues()): good_hits.append(alignment) return good_hits
def test_align_with_repeats(): sequence = """MRRGRLLEIALGFTVLLASYTSHGADANLEAGNVKETRASRAKRRGGGGHD ALKGPNVCGSRYNAYCCPGWKTLPGGNQCIVPICRHSCGDGFCSRPNMCTCPSGQIAPSCGSRSIQHCN IRCMNGGSCSDDHCLCQKGYIGTHCGQPVCESGCLNGGRCVAPNRCACTYGFTGPQCERDYRTGPCFTV ISNQMCQGQLSGIVCTKTLCCATVGRAWGHPCEMCPAQPHPCRRGFIPNIRTGACQDVDECQAIPGLCQ GGNCINTVGSFECKCPAGHKLNEVSQKCEDIDECSTIPGICEGGECTNTVSSYFCKCPPGFYTSPDGTR CIDVRPGYCYTALTNGRCSNQLPQSITKMQCCCDAGRCWSPGVTVAPEMCPIRATEDFNKLCSVPMVIP GRPEYPPPPLGPIPPVLPVPPGFPPGPQIPVPRPPVEYLYPSREPPRVLPVNVTDYCQLVRYLCQNGRC IPTPGSYRCECNKGFQLDLRGECIDVDECEKNPCAGGECINNQGSYTCQCRAGYQSTLTRTECRDIDEC LQNGRICNNGRCINTDGSFHCVCNAGFHVTRDGKNCEDMDECSIRNMCLNGMCINEDGSFKCICKPGFQ LASDGRYCKDINECETPGICMNGRCVNTDGSYRCECFPGLAVGLDGRVCVDTHMRSTCYGGYKRGQCIK PLFGAVTKSECCCASTEYAFGEPCQPCPAQNSAEYQALCSSGPGMTSAGSDINECALDPDICPNGICEN LRGTYKCICNSGYEVDSTGKNCVDINECVLNSLLCDNGQCRNTPGSFVCTCPKGFIYKPDLKTCEDIDE CESSPCINGVCKNSPGSFICECSSESTLDPTKTICIETIKGTCWQTVIDGRCEININGATLKSQCCSSL GAAWGSPCTLCQVDPICGKGYSRIKGTQCEDIDECEVFPGVCKNGLCVNTRGSFKCQCPSGMTLDATGR ICLDIRLETCFLRYEDEECTLPIAGRHRMDACCCSVGAAWGTEECEECPMRNTPEYEELCPRGPGFATK EITNGKPFFKDINECKMIPSLCTHGKCRNTIGSFKCRCDSGFALDSEERNCTDIDECRISPDLCGRGQC VNTPGDFECKCDEGYESGFMMMKNCMDIDECQRDPLLCRGGVCHNTEGSYRCECPPGHQLSPNISACID INECELSAHLCPNGRCVNLIGKYQCACNPGYHSTPDRLFCVDIDECSIMNGGCETFCTNSEGSYECSCQ PGFALMPDQRSCTDIDECEDNPNICDGGQCTNIPGEYRCLCYDGFMASEDMKTCVDVNECDLNPNICLS GTCENTKGSFICHCDMGYSGKKGKTGCTDINECEIGAHNCGKHAVCTNTAGSFKCSCSPGWIGDGIKCT DLDECSNGTHMCSQHADCKNTMGSYRCLCKEGYTGDGFTCTDLDECSENLNLCGNGQCLNAPGGYRCEC DMGFVPSADGKACEDIDECSLPNICVFGTCHNLPGLFRCECEIGYELDRSGGNCTDVNECLDPTTCISG NCVNTPGSYICDCPPDFELNPTRVGCVDTRSGNCYLDIRPRGDNGDTACSNEIGVGVSKASCCCSLGKA WGTPCEMCPAVNTSEYKILCPGGEGFRPNPITVILEDIDECQELPGLCQGGKCINTFGSFQCRCPTGYY LNEDTRVCDDVNECETPGICGPGTCYNTVGNYTCICPPDYMQVNGGNNCMDMRRSLCYRNYYADNQTCD GELLFNMTKKMCCCSYNIGRAWNKPCEQCPIPSTDEFATLCGSQRPGFVIDIYTGLPVDIDECREIPGV CENGVCINMVGSFRCECPVGFFYNDKLLVCEDIDECQNGPVCQRNAECINTAGSYRCDCKPGYRFTSTG QCNDRNECQEIPNICSHGQCIDTVGSFYCLCHTGFKTNDDQTMCLDINECERDACGNGTCRNTIGSFNC RCNHGFILSHNNDCIDVDECASGNGNLCRNGQCINTVGSFQCQCNEGYEVAPDGRTCVDINECLLEPRK CAPGTCQNLDGSYRCICPPGYSLQNEKCEDIDECVEEPEICALGTCSNTEGSFKCLCPEGFSLSSSGRR CQDLRMSYCYAKFEGGKCSSPKSRNHSKQECCCALKGEGWGDPCELCPTEPDEAFRQICPYGSGIIVGP DDSAVDMDECKEPDVCKHGQCINTDGSYRCECPFGYILAGNECVDTDECSVGNPCGNGTCKNVIGGFEC TCEEGFEPGPMMTCEDINECAQNPLLCAFRCVNTYGSYECKCPVGYVLREDRRMCKDEDECEEGKHDCT EKQMECKNLIGTYMCICGPGYQRRPDGEGCVDENECQTKPGICENGRCLNTRGSYTCECNDGFTASPNQ DECLDNREGYCFTEVLQNMCQIGSSNRNPVTKSECCCDGGRGWGPHCEICPFQGTVAFKKLCPHGRGFM TNGADIDECKVIHDVCRNGECVNDRGSYHCICKTGYTPDITGTSCVDLNECNQAPKPCNFICKNTEGSY QCSCPKGYILQEDGRSCKDLDECATKQHNCQFLCVNTIGGFTCKCPPGFTQHHTSCIDNNECTSDINLC GSKGICQNTPGSFTCECQRGFSLDQTGSSCEDVDECEGNHRCQHGCQNIIGGYRCSCPQGYLQHYQWNQ CVDENECLSAHICGGASCHNTLGSYKCMCPAGFQYEQFSGGCQDINECGSAQAPCSYGCSNTEGGYLCG CPPGYFRIGQGHCVSGMGMGRGNPEPPVSGEMDDNSLSPEACYECKINGYPKRGRKRRSTNETDASNIE DQSETEANVSLASWDVEKTAIFAFNISHVSNKVRILELLPALTTLTNHNRYLIESGNEDGFFKINQKEG ISYLHFTKKKPVAGTYSLQISSTPLYKKKELNQLEDKYDKDYLSGELGDNLKMKIQVLLH """.replace('\n','') template_id = TemplateID('2w86', 'A') residue_number = 545 domain_alignments = domain_aligner.get_domain_alignments(sequence, residue_number, template_id) domain_alignment = select_best_domain_alignment(domain_alignments) context = modeler._prepare_context(template_id.pdbid) context.set_main_target(sequence, 'HUMAN', template_id.chain_id) alignments = modeler._make_alignments(sequence, 'HUMAN', domain_alignment, context, residue_number) alignment = alignments[template_id.chain_id] ok_(alignment.is_target_residue_covered(residue_number))
def test_create_model_5x0m(): sequence = "MARFGDEMPARYGGGGSGAAAGVVVGSGGGRGAGGSRQGGQPGAQRMYKQSMAQRARTMALYNPIPVRQNCLTVNR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369 from hommod.tasks import create_model path = create_model(sequence, 'HUMAN', position, TemplateID('5x0m', 'A'))
def test_create_model_6F1T(): sequence = "MANGTADVRKLFIFTTTQNYFGLMSELWDQPLLCNCLEINNFLDDGNQMLLRVQRSDAGISFSNTIEFGDTKDKVLVFFKLRPEVITDENLHDNILVSSMLESPISSLYQAVRQVFAPMLLKDQEWSRNFDPKLQNLLSELEAGLGIVLRRSDTNLTKLKFKEDDTRGILTPSDEFQFWIEQAHRGNKQISKERANYFKELFETIAREFYNLDSLSLLEVVDLVETTQDVVDDVWRQTEHDHYPESRMLHLLDIIGGSFGRFVQKKLGTLNLWEDPYYLVKESLKAGISICEQWVIVCNHLTGQVWQRYVPHPWKNEKYFPETLDKLGKRLEEVLAIRTIHEKFLYFLPASEEKIICLTRVFEPFTGLNPVQYNPYTEPLWKAAVSQYEKIIAPAEQKIAGKLKNYISEIQDSPQQLLQAFLKYKELVKRPTISKELMLERETLLARLVDSIKDFRLDFENRCRGIPGDASGPLSGKNLSEVVNSIVWVRQLELKVDDTIKIAEALLSDLPGFRCFHQSAKDLLDQLKLYEQEQFDDWSRDIQSGLSDSRSGLCIEASSRIMELDSNDGLLKVHYSDRLVILLREVRQLSALGFVIPAKIQQVANIAQKFCKQAIILKQVAHFYNSIDQQMIQSQRPMMLQSALAFEQIIKNSKAGSGGKSQITWDNPKELEGYIQKLQNAAERLATENRKLRKWHTTFCEKVVVLMNIDLLRQQQRWKDGLQELRTGLATVEAQGFQASDMHAWKQHWNHQLYKALEHQYQMGLEALNENLPEINIDLTYKQGRLQFRPPFEEIRAKYYREMKRFIGIPNQFKGVGEAGDESIFSIMIDRNASGFLTIFSKAEDLFRRLSAVLHQHKEWIVIGQVDMEALVEKHLFTVHDWEKNFKALKIKGKEVERLPSAVKVDCLNINCNPVKTVIDDLIQKLFDLLVLSLKKSIQAHLHEIDTFVTEAMEVLTIMPQSVEEIGDANLQYSKLQERKPEILPLFQEAEDKNRLLRTVAGGGLETISNLKAKWDKFELMMESHQ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ITYLSAAPESLRKTCLEEWTKSAGLEKFDLRRFLCTESEQLIWKSEGLPSDDLSIENALVILQSRVCPFLIDPSSQATEWLKTHLKDSRLEVINQQDSNFITALELAVRFGKTLIIQEMDGVEPVLYPLLRRDLVAQGPRYVVQIGDKIIDYNEEFRLFLSTRNPNPFIPPDAASIVTEVNFTTTRSGLRGQLLALTIQHEKPDLEEQKTKLLQQEEDKKIQLAKLEESLLETLATSQGNILENKDLIESLNQTKASSALIQESLKESYKLQISLDQERDAYLPLAESASKMYFIISDLSKINNMYRFSLAAFLRLFQRALQNKQDSENTEQRIQSLISSLQHMVYEYICRCLFKADQLMFALHFVRGMHPELFQENEWDTFTGVVVGDMLRKADSQQKIRDQLPSWIDQERSWAVATLKIALPSLYQTLCFEDAALWRTYYNNSMCEQEFPSILAKKVSLFQQILVVQALRPDRLQSAMALFACKTLGLKEVSPLPLNLKRLYKETLEIEPILIIISPGADPSQELQELANAERSGECYHQVAMGQGQADLAIQMLKECARNGDWLCLKNLHLVVSWLPVLEKELNTLQPKDTFRLWLTAEVHPNFTPILLQSSLKITYESPPGLKKNLMRTYESWTPEQISKKDNTHRAHALFSLAWFHAACQERRNYIPQGWTKFYEFSLSDLRAGYNIIDRLFDGAKDVQWEFVHGLLENAIYGGRIDNYFDLRVLQSYLKQFFNSSVIDVFNQRNKKSIFPYSVSLPQSCSILDYRAVIEKIPEDDKPSFFGLPANIARSSQRMISSQVISQLRILGRSITAGSKFDREIWSNELSPVLNLWKKLNQNSNLIHQKVPPPNDRQGSPILSFIILEQFNAIRLVQSVHQSLAALSKVIRGTTLLSSEVQKLASALLNQKCPLAWQSKWEGPEDPLQYLRGLVARALAIQNWVDKAEKQALLSETLDLSELFHPDTFLNALRQETARAVGRSVDSLKFVASWKGRLQEAKLQIKISGLLLEGCSFDGNQLSENQLDSPSVSSVLPCFMGWIPQDACGPYSPDECISLPVYTSAERDRVVTNIDVPCGGNQDQWIQCGAALFLKNQ" position = 422 from hommod.tasks import create_model path = create_model(sequence, 'HUMAN', position, TemplateID('6F1T', 'e')) ok_(path is not None)
def test_create_model_LSHR_extracellular(): from hommod.tasks import create_model path = create_model( "MKQRFSALQLLKLLLLLQPPLPRALREALCPEPCNCVPDGALRCPGPTAGLTRLSLAYLPVKVIPSQAFRGLNEVIKIEISQIDSLERIEANAFDNLLNLSEILIQNTKNLRYIEPGAFINLPRLKYLSICNTGIRKFPDVTKVFSSESNFILEICDNLHITTIPGNAFQGMNNESVTLKLYGNGFEEVQSHAFNGTTLTSLELKENVHLEKMHNGAFRGATGPKTLDISSTKLQALPSYGLESIQRLIATSSYSLKKLPSRETFVNLLEATLTYPSHCCAFRNLPTKEQNFSHSISENFSKQCESTVRKVNNKTLYSSMLAESELSGWDYEYGFCLPKTPRCAPEPDAFNPCEDIMGYDFLRVLIWLINILAIMGNMTVLFVLLTSRYKLTVPRFLMCNLSFADFCMGLYLLLIASVDSQTKGQYYNHAIDWQTGSGCSTAGFFTVFASELSVYTLTVITLERWHTITYAIHLDQKLRLRHAILIMLGGWLFSSLIAMLPLVGVSNYMKVSICFPMDVETTLSQVYILTILILNVVAFFIICACYIKIYFAVRNPELMATNKDTKIAKKMAILIFTDFTCMAPISFFAISAAFKVPLITVTNSKVLLVLFYPINSCANPFLYAIFTKTFQRDFFLLLSKFGCCKRRAELYRRKDFSAYTSNCKNGFTGSNKPSQSTLKLSTLHCQGTALLDKTRYTEC", 'HUMAN', 428, TemplateID('2J4Y', 'A')) ok_(path is None)
def test_align_filamin(): sequence = """ MSSSHSRAGQSAAGAAPGGGVDTRDAEMPATEKDLAEDAPWKKIQQNTFTRWCNEHLKCVSKRIANLQTDLS DGLRLIALLEVLSQKKMHRKHNQRPTFRQMQLENVSVALEFLDRESIKLVSIDSKAIVDGNLKLILGLIWTL ILHYSISMPMWDEEEDEEAKKQTPKQRLLGWIQNKLPQLPITNFSRDWQSGRALGALVDSCAPGLCPDWDSW DASKPVTNAREAMQQADDWLGIPQVITPEEIVDPNVDEHSVMTYLSQFPKA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HIPGSPFKIRVGEPGHGGDPGLVSAYGAGLEGGVTGNPA EFVVNTSNAGAGALSVTIDGPSKVKMDCQECPEGYRVTYTPMAPGSYLISIKYGGPYHIGGSPFKAKVTGPR LVSNHSLHETSSVFVDSLTKATCAPQHGAPGPGPADASKVVAKGLGLSKAYVGQKSSFTVDCSKAGNNMLLV GVHGPRTPCEEILVKHVGSRLYSVSYLLKDKGEYTLVVKWGDEHIPGSPYRVVVP """.replace('\n','') template_id = TemplateID('4M9P', 'A') residue_number = 429 domain_alignments = domain_aligner.get_domain_alignments(sequence, residue_number, template_id) ok_(len(domain_alignments) > 0) domain_alignment = select_best_domain_alignment(domain_alignments) context = modeler._prepare_context(template_id.pdbid) context.set_main_target(sequence, 'HUMAN', template_id.chain_id) alignments = modeler._make_alignments(sequence, 'HUMAN', domain_alignment, context, residue_number) alignment = alignments[template_id.chain_id] _log.debug("alignment is {}".format(alignment)) ok_(alignment.is_target_residue_covered(residue_number))
def _choose_best_target_alignment(self, context, interacting_chain_alignments, potential_target_sequences, chain_id): best_alignment = None for target_id in potential_target_sequences: template_chain_sequence = context.get_sequence(chain_id) template_chain_secstr = context.get_secondary_structure(chain_id) alignment = kmad_aligner.align( template_chain_sequence, template_chain_secstr, potential_target_sequences[target_id]) _log.debug("alignment {} has coverage {} %".format( alignment, alignment.get_percentage_coverage())) if alignment.get_percentage_coverage() < 90.0: # If the coverage is too low, we need to bother interpro. domain_alignments = \ domain_aligner.get_domain_alignments(potential_target_sequences[target_id], None, TemplateID(context.template_pdbid, chain_id)) interacting_alignments = list( filter( lambda ali: self._preserves_interactions( context, ali.target_alignment.replace('-', ''), chain_id, interacting_chain_alignments), domain_alignments)) _log.debug( "preserve interactions with chains {}: filtered {} alignments out of {}" .format(interacting_chain_alignments.keys(), len(interacting_alignments), len(domain_alignments))) if len(interacting_alignments) > 0: domain_alignment = self._join_alignments_to_best_template_coverage( interacting_alignments) elif len(domain_alignments) > 0: domain_alignment = self._join_alignments_to_best_template_coverage( domain_alignments) else: continue alignment = kmad_aligner.align( template_chain_sequence, template_chain_secstr, domain_alignment.get_target_sequence()) alignment.target_id = target_id if best_alignment is None or \ best_alignment.get_percentage_identity() < alignment.get_percentage_identity(): best_alignment = alignment return best_alignment
def test_create_model_1RO6(): sequence = "MLHVNDLPPPRRHSWICFDVENGPSPGRSPLDPQAGSSSGLVLHAAFPGHSQRRESFLYRSDSDYDLSPKAMSRNSSLPSEQHGDDLIVTPFAQVLASLRSVRNNFTLLTNLHGAPNKRSPAASQAPVSRVSLQEESYQKLAMETLEELDWCLDQLETIQTYRSVSEMASNKFKRMLNRELTHLSEMSRSGNQVSEYISNTFLDKQNDVEIPSPTQKDREKKKKQQLMTQISGVKKLMHSSSLNNTSISRFGVNTENEDHLAKELEDLNKWGLNIFNVAGYSHNRPLTCIMYAIFQERDLLKTFKISSDTFVTYMMTLEDHYHSDVAYHNSLHAADVAQSTHVLLSTPALDAVFTDLEILAAIFAAAIHDVDHPGVSNQFLINTNSELALMYNDESVLENHHLAVGFKLLQEEHCDIFQNLTKKQRQTLRKMVIDMVLATDMSKHMSLLADLKTMVETKKVTSSGVLLLDNYTDRIQVLRNMVHCADLSNPTKSLELYRQWTDRIMEEFFQQGDKERERGMEISPMCDKHTASVEKSQVGFIDYIVHPLWETWADLVQPDAQDILDTLEDNRNWYQSMIPQSPSPPLDERSRDCQGLMEKFQFELTLEEEDSEGPEKEGEGHSYFSSTKTLCVIDPENRDSLEETDIDIATEDKSPIDT" position = 254 from hommod.tasks import create_model path = create_model(sequence, 'HUMAN', position, TemplateID('1RO6', 'A')) ok_(path is not None)
def test_create_model_kinase(): sequence = "METVISSDSSPAVENEHPQETPESNNSVYTSFMKSHRCYDLIPTSSKLVVFDTSLQVKKAFFALVTNGVRAAPLWDSKKQSFVVLRALSCPLGMLTITDFINILHRYYKSALVQIYELEEHKIETWREVYLQDSFKPLVCISPNASLFDAVSSLIRNKIHRLPVIDPESGNTLYILTHKRILKF" position = 65 from hommod.tasks import create_model path = create_model(sequence, 'HUMAN', position, TemplateID('2V8Q', 'E')) ok_(path is not None) ok_(select_best_model([path], sequence, position) is not None)
def _handle_error_txt(self, error_path, work_dir_path, context, main_domain_alignment): with open(error_path, 'r') as f: msg = f.read() if 'reward for reporting' in msg.lower(): model_name = model_storage.get_model_name(context.get_main_target_sequence(), context.target_species_id, main_domain_alignment, TemplateID(context.template_pdbid, context.main_target_chain_id)) tar_path = model_storage.get_error_tar_path(context.get_main_target_sequence(), context.target_species_id, main_domain_alignment, TemplateID(context.template_pdbid, context.main_target_chain_id)) with tarfile.open(tar_path, mode="w:gz") as ar: ar.add(work_dir_path, arcname=model_name) raise ModelRunError(msg)
def test_create_model_3srg(): sequence = "MAKLIALTLLGMGLALFRNHQSSYQTRLNALREVQPVELPNCNLVKGIETGSEDLEILPNGLAFISSGLKYPGIKSFNPNSPGKILLMDLNEEDPTVLELGITGSKFDVSSFNPHGISTFTDEDNAMYLLVVNHPDAKSTVELFKFQEEEKSLLHLKTIRHKLLPNLNDIVAVGPEHFYGTNDHYFLDPYLQSWEMYLGLAWSYVVYYSPSEVRVVAEGFDFANGINISPDGKYVYIAELLAHKIHVYEKHANWTLTPLKSLDFNTLVDNISVDPETGDLWVGCHPNGMKIFFYDSENPPASEVLRIQNILTEEPKVTQVYAENGTVLQGSTVASVYKGKLLIGTVFHKALYCEL" position = 224 from hommod.tasks import create_model path = create_model(sequence, 'HUMAN', position, TemplateID('3SRG', 'A')) ok_(path is not None)
def test_create_model_lysc(): sequence = "MKALIVLGLVLLSVTVQGKVFERCELARTLKRLGMDGYRGISLANWMCLAKWESGYNTRATNYNAGDRSTDYGIFQINSRYWCNDGKTPGAVNACHLSCSALLQDNIADAVACAKRVVRDPQGIRAWVAWRNRCQNRDVRQYVQGCGV" position = 54 from hommod.tasks import create_model path = create_model(sequence, 'HUMAN', position, TemplateID('1C7P', 'A')) ok_(path is not None)
def test_create_model_5oyd(): sequence = "MGPWGWKLRWTVALLLAAAGTAVGDRCERNEFQCQDGKCISYKWVCDGSAECQDGSDESQETCSPKTCSQDEFRCHDGKCISRQFVCDSDRDCLDGSDEASCPVLTCGPASFQCNSSTCIPQLWACDNDPDCEDGSDEWPQRCRGLYVFQGDSSPCSAFEFHCLSGECIHSSWRCDGGPDCKDKSDEENCAVATCRPDEFQCSDGNCIHGSRQCDREYDCKDMSDEVGCVNVTLCEGPNKFKCHSGECITLDKVCNMARDCRDWSDEPIKECGTNECLDNNGGCSHVCNDLKIGYECLCPDGFQLVAQRRCEDIDECQDPDTCSQLCVNLEGGYKCQCEEGFQLDPHTKACKAVGSIAYLFFTNRHEVRKMTLDRSEYTSLIPNLRNVVALDTEVASNRIYWSDLSQRMICSTQLDRAHGVSSYDTVISRDIQAPDGLAVDWIHSNIYWTDSVLGTVSVADTKGVKRKTLFRENGSKPRAIVVDPVHGFMYWTDWGTPAKIKKGGLNGVDIYSLVTENIQWPNGITLDLLSGRLYWVDSKLHSISSIDVNGGNRKTILEDEKRLAHPFSLAVFEDKVFWTDIINEAIFSANRLTGSDVNLLAENLLSPEDMVLFHNLTQPRGVNWCERTTLSNGGCQYLCLPAPQINPHSPKFTCACPDGMLLARDMRSCLTEAEAAVATQETSTVRLKVSSTAVRTQHTTTRPVPDTSRLPGATPGLTTVEIVTMSHQALGDVAGRGNEKKPSSVRALSIVLPIVLLVFLCLGVFLLWKNWRLKNINSINFDNPVYQKTTEDEVHICHNQDGYSYPSRQMVSLEDDVA" position = 38 from hommod.tasks import create_model path = create_model(sequence, 'HUMAN', position, TemplateID('5OY9', 'D')) ok_(path is None)
def test_create_model_delmol(): from hommod.tasks import create_model path = create_model( "MESADFYEAEPRPPMSSHLQSPPHAPSSAAFGFPRGAGPAQPPAPPAAPEPLGGICEHETSIDISAYIDPAA" "FNDEFLADLFQHSRQQEKAKAAVGPTGGGGGGDFDYPGAPAGPGGAVMPGGAHGPPPGYGCAAAGYLDGRLE" "PLYERVGAPALRPLVIKQEPREEDEAKQLALAGLFPYQPPPPPPPSHPHPHPPPAHLAAPHLQFQIAHCGQT" "TMHLQPGHPTPPPTPVPSPHPAPALGAAGLPGPGSALKGLGAAHPDLRASGGSGAGKAKKSVDKNSNEYRVR" "RERNNIAVRKSRDKAKQRNVETQQKVLELTSDNDRLRKRVEQLSRELDTLRGIFRQLPESSLVKAMGNCA", "HUMAN", 317, TemplateID('1H88', 'B')) ok_(path is not None)
def _get_hits(self, range_, template_id): if self.template_blast_databank is None: raise InitError("blast databank is not set") blast_hits = blaster.blastp(range_.get_sub_sequence(), self.template_blast_databank) _log.debug("{} blast hits to filter".format(len(blast_hits))) count_template_hits = 0 good_hits = [] for hit_id in blast_hits: for alignment in blast_hits[hit_id]: hit_template_id = TemplateID(alignment.get_hit_accession_code(), alignment.get_hit_chain_id()) if template_id is not None and hit_template_id != template_id: continue count_template_hits += 1 if template_id is None and blacklister.is_blacklisted(alignment.get_hit_accession_code()): continue if not dssp.has_secondary_structure(hit_template_id): continue # Replace the blast hit's alignment with the kmad alignment. template_secstr = dssp.get_secondary_structure(hit_template_id) template_sequence = dssp.get_sequence(hit_template_id) try: kmad_alignment = kmad_aligner.align(template_sequence, template_secstr, range_.get_sub_sequence()) except: _log.warn(traceback.format_exc()) # If kmad fails, then skip this one :( continue alignment.full_query_sequence = range_.sequence alignment.query_start = range_.start + 1 alignment.query_end = range_.end alignment.subject_start = 1 alignment.subject_end = len(template_sequence) alignment.query_alignment = kmad_alignment.target_alignment alignment.subject_alignment = kmad_alignment.template_alignment if alignment.get_percentage_identity() >= get_min_identity(alignment.count_aligned_residues()): good_hits.append(alignment) if count_template_hits == 0 and template_id is not None: _log.warning("domain sequence {} has no suitable hits with {}".format(range_.get_sub_sequence(), template_id)) return [] return good_hits
def test_secretase(): seq = ("MTAAVFFGCAFIAFGPALALYVFTIATEPLRIIFLIAGAFFWLVSLLISSLVWFMARVII" + "DNKDGPTQKYLLIFGAFVSVYIQEMFRFAYYKLLKKASEGLKSINPGETAPSMRLLAYVS" + "GLGFGIMSGVFSFVNTLSDSLGPGTVGIHGDSPQFFLYSAFMTLVIILLHVFWGIVFFDG" + "CEKKKWGILLIVLLTHLLVSAQTFISSYYGINLASAFIILVLMGTWAFLAAGGSCRSLKL" + "CLLCQDKNFLLYNQRSR") template_id = TemplateID('5A63', 'C') alignments = domain_aligner.get_domain_alignments(seq, require_resnum=72, template_id=template_id) ok_(len(alignments) > 0) for alignment in alignments: eq_(alignment.template_id, template_id)
def test_create_model_cox(): from hommod.tasks import create_model path = create_model( "MLATRVFSLVGKRAISTSVCVRAHESVVKSEDFSLPAYMDRRDHPLPEVAHVKHLSASQKALKEKEKASWSS" + "LSMDEKVELYRIKFKESFAEMNRGSNEWKTVVGGAMFFIGFTALVIMWQKHYVYGPLPQSFDKEWVAKQTKR" + "MLDMKVNPIQGLASKWDYEKNEWKK", "HUMAN", None, TemplateID('2y69', 'D')) ok_(path is not None) name = os.path.splitext(os.path.basename(path))[0] pdb_name = os.path.join(name, 'target.pdb') with tarfile.open(path) as tf: ok_(pdb_name in tf.getnames()) alignments = model_storage.extract_alignments(path) ok_(len(alignments) >= 13)
def test_3ly6_A(): seq = ("MGQGEPSQRSTGLAGLYAAPAASPVFIKGSGMDALGIKSCDFQAARNNEEHHTKALSSRRLFVR" + "RGQPFTIILYFRAPVRAFLPALKKVALTAQTGEQPSKINRTQATFPISSLGDRKWWSAVVEERD" + "AQSWTISVTTPADAVIGHYSLLLQVSGRKQLLLGQFTLLFNPWNREDAVFLKNEAQRMEYLLNQ" + "NGLIYLGTADCIQAESWDFGQFEGDVIDLSLRLLSKDKQVEKWSQPVHVARVLGALLHFLKEQR" + "VLPTPQTQATQEGALLNKRRGSVPILRQWLTGRGRPVYDGQAWVLAAVACTVLRCLGIPARVVT" + "TFASAQGTGGRLLIDEYYNEEGLQNGEGQRGRIWIFQTSTECWMTRPALPQGYDGWQILHPSAP" + "NGGGVLGSCDLVVRAVKEGTLGLTPAVSDLFAAINASCVVWKCCEDGTLELTDSNTKYVGNNIS" + "TKGVGSDRCEDITQNYKYPEGSLQEKEVLERVEKEKMEREKDNGIRPPSLETASPLYLLLKAPS" + "SLPLRGDAQISVTLVNHSEQEKAVQLAIGVQAVHYNGVLAAKLWRKKLHLTLSANLEKIITIGL" + "FFSNFERNPPENTFLRLTAMATHSESNLSCFAQEDIAICRPHLAIKMPEKAEQYQPLTASVSLQ" + "NSLDAPMEDCVISILGRGLIHRERSYRFRSVWPENTMCAKFQFTPTHVGLQRLTVEVDCNMFQN" + "LTNYKSVTVVAPELSA") template_id = TemplateID('3LY6', 'A') alignments = domain_aligner.get_domain_alignments(seq, template_id=template_id) ok_(alignments[0].range.get_length() <= len(seq))
def test_conversion(): full_sequence = """ MKMASTRCKLARYLEDLEDVDLKKFKMHLEDYPPQKGCIPLPRGQTEKADHVDLATLMIDFNGEEKAWAMAV WIFAAINRRDLYEKAKRDEPKWGSDNARVSNPTVICQEDSIEEEWMGLLEYLSRISICKMKKDYRKKYRKYV RSRFQCIEDRNARLGESVSLNKRYTRLRLIKEHRSQQEREQELLAIGKTKTCESPVSPIKMELLFDPDDEHS EPVHTVVFQGAAGIGKTILARKMMLDWASGTLYQDRFDYLFYIHCREVSLVTQRSLGDLIMSCCPDPNPPIH KIVRKPSRILFLMDGFDELQGAFDEHIGPLCTDWQKAERGDILLSSLIRKKLLPEASLLITTRPVALEKLQH LLDHPRHVEILGFSEAKRKEYFFKYFSDEAQARAAFSLIQENEVLFTMCFIPLVCWIVCTGLKQQMESGKSL AQTSKTTTAVYVFFLSSLLQPRGGSQEHGLCAHLWGLCSLAADGIWNQKILFEESDLRNHGLQKADVSAFLR MNLFQKEVDCEKFYSFIHMTFQEFFAAMYYLLEEEKEGRTNVPGSRLKLPSRDVTVLLENYGKFEKGYLIFV VRFLFGLVNQERTSYLEKKLSCKISQQIRLELLKWIEVKAKAKKLQIQPSQLELFYCLYEMQEEDFVQRAMD YFPKIEINLSTRMDHMVSSFCIENCHRVESLSLGFLHNMPKEEEEEEKEGRHLDMVQCVLPSSSHAACSHGL VNSHLTSSFCRGLFSVLSTSQSLTELDLSDNSLGDPGMRVLCETLQHPGCNIRRLWLGRCGLSHECCFDISL VLSSNQKLVELDLSDNALGDFGIRLLCVGLKHLLCNLKKLWLVSCCLTSACCQDLASVLSTSHSLTRLYVGE NALGDSGVAILCEKAKNPQCNLQKLGLVNSGLTSVCCSALSSVLSTNQNLTHLYLRGNTLGDKGIKLLCEGL LHPDCKLQVLELDNCNLTSHCCWDLSTLLTSSQSLRKLSLGNNDLGDLGVMMFCEVLKQQSCLLQNLGLSEM YFNYETKSALETLQEEKPELTVVFEPSW """.replace('\n', '') alignment = BlastAlignment('pdb|5IRM|C', full_sequence, 'pdb', 198, 452, "SPVSPIKMELLFDPDDEHSEPVHTVVFQGAAGIGKTILARKMMLDWASGTLYQDRFDYLF" + "YIHCREVSLVTQR-SLGDLIMS-CC-PDPNPP-IHK-IVRKPSRILFLMDGFDELQGAF-" + "DE--HIGPLCTDWQKAERGDILLSSLIRKKLLPEASLLITTRPVALEKLQHLLDHPRHVE" + "ILGFSEAKRKEYFFKYFSDEAQARAAFSLIQENEVLFTMCFIPLVCWIVCTGLKQQMESG" + "KSLAQTSKTTTAVYVFFLSSLLQ", 1, 252, "SPAA-LGLEELFSPNGHLNEDADTVLVVGEAGSGKSTLLQQVHLLWATGQDFQE-FLFVF" + "PFSCRQLQCVARPLSVMTLLFEHCCWPDVGQQDVFQFLLDHPDRILLTFDGFDEFKFKFT" + "DHERHCSP--TDPTSVQ---TLLFNLLQGNLLKNARKVLTSRPDAVSAF-LRKYVRTEFN" + "LKGFSEEGIELYLRKCHREPGVADRLIHLLQTTSALHGLCHLPVFSWMV--S-KCHQELL" + "LQDGGSPKTTTDMYLLILQHFLR") range_ = alignment.get_query_range() template_id = TemplateID('5IRM', 'C') domain_alignment = DomainAlignment(alignment.query_alignment, alignment.subject_alignment, range_, template_id) ok_(domain_alignment.is_target_residue_covered(317))
def test_create_model_5MHF(): from hommod.tasks import create_model path = create_model( "MARGERRRRAVPAEGVRTAERAARGGPGRRDGRGGGPRSTAGGVALAVVVLSLALGMSGRWVLAWYRARRAV" "TLHSAPPVLPADSSSPAVAPDLFWGTYRPHVYFGMKTRSPKPLLTGLMWAQQGTTPGTPKLRHTCEQGDGVG" "PYGWEFHDGLSFGRQHIQDGALRLTTEFVKRPGGQHGGDWSWRVTVEPQDSGTSALPLVSLFFYVVTDGKEV" "LLPEVGAKGQLKFISGHTSELGDFRFTLLPPTSPGDTAPKYGSYNVFWTSNPGLPLLTEMVKSRLNSWFQHR" "PPGAPPERYLGLPGSLKWEDRGPSGQGQGQFLIQQVTLKIPISIEFVFESGSAQAGGNQALPRLAGSLLTQA" "LESHAEGFRERFEKTFQLKEKGLSSGEQVLGQAALSGLLGGIGYFYGQGLVLPDIGVEGSEQKVDPALFPPV" "PLFTAVPSRSFFPRGFLWDEGFHQLVVQRWDPSLTREALGHWLGLLNADGWIGREQILGDEARARVPPEFLV" "QRAVHANPPTLLLPVAHMLEVGDPDDLAFLRKALPRLHAWFSWLHQSQAGPLPLSYRWRGRDPALPTLLNPK" "TLPSGLDDYPRASHPSVTERHLDLRCWVALGARVLTRLAEHLGEAEVAAELGPLAASLEAAESLDELHWAPE" "LGVFADFGNHTKAVQLKPRPPQGLVRVVGRPQPQLQYVDALGYVSLFPLLLRLLDPTSSRLGPLLDILADSR" "HLWSPFGLRSLAASSSFYGQRNSEHDPPYWRGAVWLNVNYLALGALHHYGHLEGPHQARAAKLHGELRANVV" "GNVWRQYQATGFLWEQYSDRDGRGMGCRPFHGWTSLVLLAMAEDY", "HUMAN", 100, TemplateID('5MHF', 'D')) ok_(path is not None) contents = model_storage.extract_model(path) ok_(contents is not None)
def test_align_rab3d(): sequence = "MDEDVLTTLKILIIGESGVGKSSLLLRFTDDTFDPELAATIGVDFKVKTISVDGN" + \ "KAKLAIWVTLHQQTANFFLKSQIGNSPILKWAMWQYDTAGQERFRTLTPSYYRGAQGVILVYDVTRRDTF" + \ "VKLDNWLNELETYCTRNDIVNMLVGNKIDKENREVDRNEGLKFARKHSMLFIEASAKTCDGVQCAFEELV" + \ "EKIIQTPGLWESENQNKGVKLSHREEGQGGGACGGYCSVL" template_id = TemplateID('2GF9', 'A') residue_number = 70 domain_alignments = domain_aligner.get_domain_alignments(sequence, residue_number, template_id) if len(domain_alignments) > 0: domain_alignment = select_best_domain_alignment(domain_alignments) context = modeler._prepare_context(template_id.pdbid) context.set_main_target(sequence, 'HUMAN', template_id.chain_id) alignments = modeler._make_alignments(sequence, 'HUMAN', domain_alignment, context, residue_number) alignment = alignments[template_id.chain_id] ok_(alignment.is_target_residue_covered(residue_number))