我有如下一個數據幀,df1和df2:像 # data
df1 <- read.table(text = "
SNP CHR BP A1 A2 zscore P CEUmaf LOC
rs58043752 1 3344877 A G 0.289 0.7726 . 1:3344877
rs2483242 1 3345145 A T 0.393 0.6946 .
這是我寫的將dna序列翻譯成蛋白質序列的代碼。該功能起作用,但是當我嘗試輸出蛋白質序列時,只有最後一個序列出現在文件中。 def translate(dna_seq): #create function
"this function translates a dna sequence into a single letter code amino acid sequence"