Entering edit mode
10.4 years ago
ruchiksy
▴
50
Hello,
I have two .txt files. Both files contain data regarding splice junctions and I'd like to create a very simple bar graph to see the distribution of Novel RNA sequences. The splice junctions come out of two different mapping methods.
I have written some python code but am a novice so I am having some difficulty in debugging. Here is my code:
# This script will plot the comparison between the BodyMap Gencode & BodyMap RefSeq paired end data.
import matplotlib.pyplot as plt
import numpy as np
#Reading in the files
with open("Illumina_Heart_Gencode_Aligned_Novel_Junctions.txt") as f:
data = f.read()
data = data.split('\n')
x = [row.split(' ')[0] for row in data]
y = [row.split(' ')[1] for row in data]
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.set_title("BodyMap Gencode Vs. RefSeq")
ax1.set_xlabel("Novel & Splice Junctions")
ax1.set_ylabel("Something")
ax1.plot(x,y, c='r', label='the data')
leg = ax1.legend()
plt.show()
I'd like to read in the 6th and 7th columns from both text files for comparison, rest of the columns are immaterial. Could I receive some pointers?
Thank you,
You might want to provide more information on your original files. You mention two files but you are only reading in one in your code. You say you want columns 6 ad 7, but are they numbers? Strings? What do they represent? Is it junction expression? Is it the junction ID?