I´m trying to read a text file that is in columns formats, here is how it looks like:
AVP78031.1_NA 18 NLTG 0.7234 (9/9) ++
AVP78031.1_NA 28 NYTN 0.7796 (9/9) +++
AVP78031.1_NA 31 NSSQ 0.5689 (6/9) +
AVP78031.1_NA 62 NVSW 0.7594 (9/9) +++
...
My goal is to take the first, second, and fourth columns. So for that, I use a for loop to take the text/values in each column. Here are the lines of
S_align = AlignIO.read("S_aa_MSA_pathogenic.fasta", "fasta")
with open("BatlikeSARS_N.csv") as f:
lines = f.readlines()
#print(lines)
result=[]
for x in lines:
### HERE IS THE TYPE ERROR
result.append(x.split(" ")[0],[1],[3])
#print(len(result))
print(result)
This code gives me this error:
TypeError: append() takes exactly one argument (3 given)
I partially understand the error, because I suppose that the split (0, 1, and 3) are correct; however, it's obvious that something is wrong. Any idea to chance the script or add some lines is welcome!