Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mboudet committed Aug 26, 2021
1 parent 707e34e commit e049d40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
11 changes: 3 additions & 8 deletions askomics/libaskomics/GffFile.py
Expand Up @@ -49,12 +49,8 @@ def __init__(self, app, session, file_info, host_url=None, external_endpoint=Non
def set_preview(self):
"""Summary"""
try:
# exam = GFFExaminer()
handle = open(self.path, encoding="utf-8", errors="ignore")
# gff_type = exam.available_limits(handle)['gff_type']
# for entity in gff_type:
# self.entities.append(entity[0])

handle = open(self.path, encoding="utf-8", errors="ignore")
data = defaultdict(lambda: set())
for rec in GFF.parse(handle, target_lines=1):
for feature in rec.features:
Expand Down Expand Up @@ -190,11 +186,10 @@ def generate_rdf_content(self):
for feature in rec.features:

filter_attributes = False
selected_attributes = []
selected_attributes = self.attributes_to_integrate.get(feature.type, [])

if self.attributes_to_integrate.get(feature.type):
if selected_attributes:
filter_attributes = True
selected_attributes = self.attributes_to_integrate.get(feature.type, [])

# Entity type
entity_type = self.namespace_data[self.format_uri(feature.type, remove_space=True)]
Expand Down
15 changes: 5 additions & 10 deletions askomics/react/src/routes/integration/gffpreview.jsx
Expand Up @@ -20,7 +20,8 @@ export default class GffPreview extends Component {
privateTick: false,
customUri: "",
externalEndpoint: "",
subEntities: {}
subEntities: {},
errorMessage: null
}

let subEntities = {}
Expand Down Expand Up @@ -74,10 +75,6 @@ export default class GffPreview extends Component {
})
}

isChecked(value){
return this.state.entitiesToIntegrate.hasOwnProperty(value);
}


handleSelection (event) {
let value = event.target.value
Expand Down Expand Up @@ -143,7 +140,6 @@ export default class GffPreview extends Component {
}

let body
let id = 0
if (this.props.file.error) {
body = <ErrorDiv status={500} error={this.props.file.error} errorMessage={this.props.file.error_message} />
} else {
Expand All @@ -155,16 +151,15 @@ export default class GffPreview extends Component {
<div>
<FormGroup check>
{Object.entries(this.state.availableAttributes).map(([key, values]) => {
id +=1
return (
<div key={key}>
<div>
<div>
<p key={key + "_" + id}><Input value={key} onClick={this.handleSelection} type="checkbox"/> {key}</p>
<p><Input value={key} onClick={this.handleSelection} type="checkbox"/> {key}</p>
<FormGroup check inline hidden={this.state.entitiesToIntegrate.has(key)? false : true}>
Attributes of the entity:
{
values.map((value, valkey) => {
return (<div>&nbsp;<Input value={value} name={key} onClick={this.handleSubSelection} type="checkbox" defaultChecked={true} />{value}</div>)
return (<div key={key + "_" + value}>&nbsp;<Input value={value} name={key} onClick={this.handleSubSelection} type="checkbox" defaultChecked={true} />{value}</div>)
})
}
</FormGroup>
Expand Down

0 comments on commit e049d40

Please sign in to comment.