Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions htsget_server/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,13 @@ def create_pos_buckets_for_variantfile(obj):
session.bulk_insert_mappings(PositionBucketVariantFileAssociation, pbvfs_to_add)
session.commit()

with Session() as session:
new_variantfile = session.query(VariantFile).filter_by(id=variantfile_id).one_or_none()
if new_variantfile is not None:
new_variantfile.indexed = 1
session.add(new_variantfile)
session.commit()
Comment on lines +579 to +583
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the new variantfile doesn't exist in the database, should it create a new entry?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so: this is actually the second time we look up a variantfile in this method; the first time is at the top, and that time it returns None:

        if new_variantfile is None:
            logger.debug(f"couldn't find variantfile {variantfile_id}")
            return None # we can't work on nonexistent variantfiles


return None


Expand Down
4 changes: 2 additions & 2 deletions htsget_server/htsget_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ def _get_experiment(id_=None):
elif drs_obj["type"] == "read":
result["reads"].append(drs_obj["name"])
return result, 200
else:
return resp.text, resp.status_code
return f"{id_} is not an Experiment", 404
return resp.text, resp.status_code


def _get_htsget_url(id, reference_name, slice_start, slice_end, file_type, data=True):
Expand Down