Skip to content

Commit

Permalink
final fix for nucleotide positioning #86
Browse files Browse the repository at this point in the history
  • Loading branch information
josiahseaman committed Jun 3, 2020
1 parent c76a6ca commit 3219b14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,14 +651,11 @@ class App extends Component {
(schematizeComponent, i) => {
// The dummy component (firstBin and lastBin equal to 0) is not loaded in this.schematic.components, but there is a nucleotide for it in the FASTA file.
// If the first component has firstBin == 1, then in the FASTA there is a nucleotide not visualized, so the shift start from 0, and not 1
const nt_shift =
this.schematic.components[0].firstBin === 1
? 0
: this.schematic.components[0].firstBin;
const nt_shift = this.schematic.components[0].firstBin || 1;

const nucleotides_slice = this.schematic.nucleotides.slice(
schematizeComponent.firstBin - nt_shift,
schematizeComponent.lastBin - nt_shift + 1
schematizeComponent.firstBin - nt_shift, // firstBin is 1 indexed, but this is canceled by nt_shift
schematizeComponent.lastBin - nt_shift + 1 // inclusive end
);

//console.log("nucleotides_slice: " + nucleotides_slice);
Expand Down
4 changes: 2 additions & 2 deletions src/ViewportInputsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RootStore = types
chunkIndex: ChunkIndex,
beginEndBin: types.optional(types.array(types.integer), [1, 100]),
useVerticalCompression: false,
useWidthCompression: false,
useWidthCompression: true,
binScalingFactor: 3,
useConnector: true,
pixelsPerColumn: 10,
Expand All @@ -43,7 +43,7 @@ RootStore = types
highlightedLink: 0, // we will compare linkColumns
maximumHeightThisFrame: 150,
cellToolTipContent: "",
jsonName: "run1.B1phi1.i1.seqwish.v16",
jsonName: "SARS-CoV-b2",
// Added attributes for the zoom level management
availableZoomLevels: types.optional(types.array(types.string), ["1"]),
indexSelectedZoomLevel: 0,
Expand Down

0 comments on commit 3219b14

Please sign in to comment.