Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webservice #1907

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion js/feature/featureFileReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,15 @@ class FeatureFileReader {
data = await igvxhr.loadByteArray(this.config.url, options)
}


// If the data size is < max string length decode entire string with TextDecoder. This is much faster
// than decoding by line
if (data.length < MAX_STRING_LENGTH) {
data = new TextDecoder().decode(data)
}



let dataWrapper = getDataWrapper(data)
this.header = await this.parser.parseHeader(dataWrapper)

Expand Down Expand Up @@ -299,6 +301,7 @@ class FeatureFileReader {
const dataWrapper = getDataWrapper(slicedData)
await this._parse(allFeatures, dataWrapper, chr, end, start)


}

return allFeatures
Expand Down Expand Up @@ -337,6 +340,7 @@ class FeatureFileReader {
}
})


// Filter features not in requested range.
if (undefined === chr) {
for (let f of features) allFeatures.push(f) // Don't use spread operator !!! slicedFeatures might be very large
Expand All @@ -357,8 +361,8 @@ class FeatureFileReader {
allFeatures.push(features[i - 1])
}
}
allFeatures.push(f)
}
allFeatures.push(f)
}
}
}
Expand Down Expand Up @@ -398,7 +402,9 @@ class FeatureFileReader {

dataWrapper = getDataWrapper(plain)
const features = []

await this._parse(features, dataWrapper)

return features
}
}
Expand Down
Loading