Complementing a Strand of DNA

Problem

In DNA stringssymbols 'A' and 'T' are complements of each other, as are 'C' and 'G'.

The reverse complement of a DNA string   is the string   formed by reversing the symbols of  , then taking the complement of each symbol (e.g., the reverse complement of "GTCA" is "TGAC").

Given: A DNA string   of length at most 1000 bp.

Return: The reverse complement   of  .

Sample Dataset

AAAACCCGGT

Sample Output

ACCGGGTTTT 

翻译,用了一个hash表来弄,比if,switch什么的好用。
file=open('rosalind_revc.txt','r');
seq=file.read();
print(seq)
leng=len(seq);
tran={'A':'T','T':'A','C':'G','G':'C'};
trna=[];
for i in range(0,leng):
	trna.append(tran[seq[leng-1-i]]);
trna_convert=''.join(trna);
f=open('out3.txt','w')
f.write(trna_convert)
f.close
注意:每次用下载的txt都会出现keyerror,是因为我不是按行读取的,直接把文件全部读入,文件最后提行了。多了个\n
list还要先定义,write的时候不能直接是list,不知道怎么写,就把list转成str了,trna_convert=''.join(trna)



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Compared with homogeneous network-based methods, het- erogeneous network-based treatment is closer to reality, due to the different kinds of entities with various kinds of relations [22– 24]. In recent years, knowledge graph (KG) has been utilized for data integration and federation [11, 17]. It allows the knowledge graph embedding (KGE) model to excel in the link prediction tasks [18, 19]. For example, Dai et al. provided a method using Wasser- stein adversarial autoencoder-based KGE, which can solve the problem of vanishing gradient on the discrete representation and exploit autoencoder to generate high-quality negative samples [20]. The SumGNN model proposed by Yu et al. succeeds in inte- grating external information of KG by combining high-quality fea- tures and multi-channel knowledge of the sub-graph [21]. Lin et al. proposed KGNN to predict DDI only based on triple facts of KG [66]. Although these methods have used KG information, only focusing on the triple facts or simple data fusion can limit performance and inductive capability [69]. Su et al. successively proposed two DDIs prediction methods [55, 56]. The first one is an end-to-end model called KG2ECapsule based on the biomedical knowledge graph (BKG), which can generate high-quality negative samples and make predictions through feature recursively propagating. Another one learns both drug attributes and triple facts based on attention to extract global representation and obtains good performance. However, these methods also have limited ability or ignore the merging of information from multiple perspectives. Apart from the above, the single perspective has many limitations, such as the need to ensure the integrity of related descriptions, just as network-based methods cannot process new nodes [65]. So, the methods only based on network are not inductive, causing limited generalization [69]. However, it can be alleviated by fully using the intrinsic property of the drug seen as local information, such as chemical structure (CS) [40]. And a handful of existing frameworks can effectively integrate multi-information without losing induction [69]. Thus, there is a necessity for us to propose an effective model to fully learn and fuse the local and global infor- mation for improving performance of DDI identification through multiple information complementing.是什么意思
06-11

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值