supercat666 commited on
Commit
648e88d
1 Parent(s): 3488e95

fixed plot

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. cas9on.py +1 -4
app.py CHANGED
@@ -134,7 +134,8 @@ if selected_model == 'Cas9':
134
 
135
  gbk = Genbank(genbank_file_path)
136
  track = gv.add_feature_track(gbk.name, gbk.range_size)
137
- track.add_genbank_features(gbk)
 
138
 
139
  fig = gv.plotfig()
140
  st.pyplot(fig)
 
134
 
135
  gbk = Genbank(genbank_file_path)
136
  track = gv.add_feature_track(gbk.name, gbk.range_size)
137
+ # Make sure you are adding features of the type that are present in your GenBank file
138
+ track.add_genbank_features(gbk, feature_types=["misc_feature"]) # Specify feature types if needed
139
 
140
  fig = gv.plotfig()
141
  st.pyplot(fig)
cas9on.py CHANGED
@@ -128,11 +128,8 @@ def process_gene(gene_symbol, model_path):
128
  def create_genbank_features(gRNAs, predictions):
129
  features = []
130
  for gRNA, prediction in zip(gRNAs, predictions):
131
- # Assuming gRNA structure: [Target Seq, Chrom, Start Pos, End Pos, Strand]
132
- # And prediction is a single floating point value
133
  location = FeatureLocation(start=gRNA[2], end=gRNA[3], strand=gRNA[4])
134
- # Creating a feature with type 'CDS' just as an example, change as appropriate
135
- feature = SeqFeature(location=location, type="CDS", qualifiers={
136
  'label': gRNA[0], # Target sequence as label
137
  'note': f"Prediction: {prediction}" # Prediction score in note
138
  })
 
128
  def create_genbank_features(gRNAs, predictions):
129
  features = []
130
  for gRNA, prediction in zip(gRNAs, predictions):
 
 
131
  location = FeatureLocation(start=gRNA[2], end=gRNA[3], strand=gRNA[4])
132
+ feature = SeqFeature(location=location, type="misc_feature", qualifiers={
 
133
  'label': gRNA[0], # Target sequence as label
134
  'note': f"Prediction: {prediction}" # Prediction score in note
135
  })