Skip to content

Commit

Permalink
Merge 38bd328 into 0fe36d1
Browse files Browse the repository at this point in the history
  • Loading branch information
mboudet committed Jul 27, 2023
2 parents 0fe36d1 + 38bd328 commit 510d63f
Show file tree
Hide file tree
Showing 9 changed files with 277 additions and 81 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/github-publish-celery-flaskomics.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Flaskomics Docker image to github
name: Publish Flaskomics Docker image to github

on:
push:
Expand All @@ -14,13 +14,14 @@ env:

jobs:
build-and-push-image:
if: github.repository == 'askomics/flaskomics'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
-
-
name: Checkout repository
uses: actions/checkout@v3

Expand Down Expand Up @@ -60,7 +61,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/DockerfileCelery
file: ./docker/DockerfileCelery
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
5 changes: 3 additions & 2 deletions .github/workflows/github-publish-flaskomics.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Flaskomics Docker image to github
name: Publish Flaskomics Docker image to github

on:
push:
Expand All @@ -14,13 +14,14 @@ env:

jobs:
build-and-push-image:
if: github.repository == 'askomics/flaskomics'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
-
-
name: Checkout repository
uses: actions/checkout@v3

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ This changelog was started for release 4.2.0.
- Fixed Gff Faldo integration (was only integrating the last selected entity)
- Fixed an issue when using filters and an 'UNION' node
- Fixed an issue when launching a query with a 'linked' attribute toggled but unselected
- Fixed missing includeIn and includeInReference in bed files
- Fixed 'overlap_with' faldo query

### Changed

Expand Down
10 changes: 10 additions & 0 deletions askomics/libaskomics/BedFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,14 @@ def generate_rdf_content(self):
self.graph_chunk.add((begin, rdflib.RDF.type, faldo_strand))
self.graph_chunk.add((end, rdflib.RDF.type, faldo_strand))

# blocks
block_base = self.settings.getint("triplestore", "block_size")
block_start = int(self.convert_type(feature.start + 1)) // block_base
block_end = int(self.convert_type(feature.end)) // block_base

for slice_block in range(block_start, block_end + 1):
self.graph_chunk.add((entity, self.namespace_internal['includeIn'], rdflib.Literal(int(slice_block))))
block_reference = self.rdfize(self.format_uri("{}_{}".format(feature.chrom, slice_block)))
self.graph_chunk.add((entity, self.namespace_internal["includeInReference"], block_reference))

yield
12 changes: 12 additions & 0 deletions askomics/libaskomics/Database.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def create_results_table(self):
template boolean,
has_form_attr boolean,
form boolean,
version text,
FOREIGN KEY(user_id) REFERENCES users(user_id)
)
'''
Expand Down Expand Up @@ -355,6 +356,17 @@ def update_results_table(self):
except Exception:
pass

query = '''
ALTER TABLE results
ADD version text NULL
DEFAULT(NULL)
'''

try:
self.execute_sql_query(query)
except Exception:
pass

def create_endpoints_table(self):
"""Create the endpoints table"""
query = '''
Expand Down
18 changes: 9 additions & 9 deletions askomics/libaskomics/GffFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,15 @@ def generate_rdf_content(self):
self.graph_chunk.add((begin, rdflib.RDF.type, faldo_strand))
self.graph_chunk.add((end, rdflib.RDF.type, faldo_strand))

# blocks
block_base = self.settings.getint("triplestore", "block_size")
block_start = int(self.convert_type(feature.location.start)) // block_base
block_end = int(self.convert_type(feature.location.end)) // block_base

for slice_block in range(block_start, block_end + 1):
self.graph_chunk.add((entity, self.namespace_internal['includeIn'], rdflib.Literal(int(slice_block))))
block_reference = self.rdfize(self.format_uri("{}_{}".format(rec.id, slice_block)))
self.graph_chunk.add((entity, self.namespace_internal["includeInReference"], block_reference))
# blocks
block_base = self.settings.getint("triplestore", "block_size")
block_start = int(self.convert_type(feature.location.start)) // block_base
block_end = int(self.convert_type(feature.location.end)) // block_base

for slice_block in range(block_start, block_end + 1):
self.graph_chunk.add((entity, self.namespace_internal['includeIn'], rdflib.Literal(int(slice_block))))
block_reference = self.rdfize(self.format_uri("{}_{}".format(rec.id, slice_block)))
self.graph_chunk.add((entity, self.namespace_internal["includeInReference"], block_reference))

yield

Expand Down
6 changes: 5 additions & 1 deletion askomics/libaskomics/Result.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from askomics.libaskomics.Params import Params
from askomics.libaskomics.Utils import Utils

from pkg_resources import get_distribution


class Result(Params):
"""Result represent a query result file
Expand Down Expand Up @@ -381,6 +383,7 @@ def save_in_db(self, start=None):
?,
?,
?,
?,
?
)
'''
Expand All @@ -396,7 +399,8 @@ def save_in_db(self, start=None):
json.dumps({"graphs": self.graphs, "endpoints": self.endpoints}),
False,
self.session["user"]["admin"] and any([attrib.get("form") for attrib in self.graph_state["attr"]]) if (self.graph_state and self.graph_state.get("attr")) else False,
False
False,
get_distribution('askomics').version
), get_id=True)

return self.id
Expand Down

0 comments on commit 510d63f

Please sign in to comment.