Skip to content

User tracking #3419

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

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d743a81
make help email address configurable instead of hard coding (#3384)
sjanssen2 Mar 21, 2024
8c91945
PR: Resource allocation plots in util.py (#3382)
Gossty Mar 27, 2024
667a22a
add trailing/separating whitespace (#3385)
sjanssen2 Apr 2, 2024
83476d5
Config statsmap lat long (#3388)
sjanssen2 Apr 4, 2024
8660043
qiita.slurm_resource_allocations (#3391)
antgonza Apr 16, 2024
fe50614
Pac bio smrt new instruments (#3390)
antgonza Apr 16, 2024
28d7191
Adding current human filtering flag to prep_template (#3395)
antgonza Apr 22, 2024
8b833d3
Fix 3352 (#3397)
antgonza Apr 23, 2024
b4a7caf
Fix 3387 (#3398)
antgonza Apr 23, 2024
68fa3e2
Fix 3376 (#3399)
antgonza Apr 23, 2024
6d27147
Update qiita prep temp06182020 (#3400)
antgonza Apr 26, 2024
748126a
add reprocess_job_id to PrepTemplate (#3396)
antgonza Apr 26, 2024
7b9cb33
Clean plugins (#3403)
antgonza May 7, 2024
7c7600e
adding test_db_sql (#3405)
antgonza May 7, 2024
6ac8ee8
ext documentation nginx mod_zip (#3409)
sjanssen2 May 16, 2024
c0cdb4b
Fix 3381 (#3408)
antgonza May 16, 2024
55e460e
Test util db (#3406)
Gossty May 21, 2024
1ffd9a0
Fix msg admin none (#3410)
antgonza Jun 4, 2024
ffe1ec8
change color of msg to green by default and only to red if msg starts…
sjanssen2 Jun 4, 2024
9de3f38
Add social handles (#3412)
sjanssen2 Jun 5, 2024
cca6de7
qiita.slurm_resource_allocations insertion (#3415)
Gossty Jun 19, 2024
8b3f717
log user creation timestamp (#3416)
sjanssen2 Jun 20, 2024
fd2d9b7
Purge non-verified user (#3417)
sjanssen2 Jun 20, 2024
751e559
add missing template (#3418)
sjanssen2 Jun 20, 2024
0f83916
adding new section "user_tracking" to settings with one variable JS_CODE
sjanssen2 Jun 21, 2024
89d34b6
inject tracking code if JS_CODE in user_tracking section of settings …
sjanssen2 Jun 21, 2024
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
Prev Previous commit
Next Next commit
Adding current human filtering flag to prep_template (#3395)
* Update CHANGELOG.md

* adding current_human_filtering to PrepTemplate
  • Loading branch information
antgonza authored Apr 22, 2024
commit 28d719157cfcf68ee8a35596287a332d425ca7dd
10 changes: 9 additions & 1 deletion qiita_db/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,15 @@ def being_deleted_by(self):
@property
def has_human(self):
has_human = False
if self.artifact_type == 'per_sample_FASTQ':
# we are going to check the metadata if:
# - the prep data_type is _not_ target gene
# - the prep is not current_human_filtering
# - if the artifact_type is 'per_sample_FASTQ'
pts = self.prep_templates
tgs = qdb.metadata_template.constants.TARGET_GENE_DATA_TYPES
ntg = any([pt.data_type() not in tgs for pt in pts])
chf = any([not pt.current_human_filtering for pt in pts])
if ntg and chf and self.artifact_type == 'per_sample_FASTQ':
st = self.study.sample_template
if 'env_package' in st.categories:
sql = f"""SELECT DISTINCT sample_values->>'env_package'
Expand Down
25 changes: 25 additions & 0 deletions qiita_db/metadata_template/prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,3 +1082,28 @@ def creation_job_id(self, creation_job_id):
WHERE prep_template_id = %s"""
qdb.sql_connection.TRN.add(sql, [creation_job_id, self.id])
qdb.sql_connection.TRN.execute()

@property
def current_human_filtering(self):
"""If the preparation is current with human filtering

Returns
-------
bool
The current_human_filtering of the prep information
"""
with qdb.sql_connection.TRN:
sql = """SELECT current_human_filtering
FROM qiita.prep_template
WHERE prep_template_id = %s"""
qdb.sql_connection.TRN.add(sql, [self.id])
return qdb.sql_connection.TRN.execute_fetchlast()

@current_human_filtering.setter
def current_human_filtering(self, current_human_filtering):
with qdb.sql_connection.TRN:
sql = """UPDATE qiita.prep_template
SET current_human_filtering = %s
WHERE prep_template_id = %s"""
qdb.sql_connection.TRN.add(sql, [current_human_filtering, self.id])
qdb.sql_connection.TRN.execute()
9 changes: 9 additions & 0 deletions qiita_db/metadata_template/test/test_prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,15 @@ def test_name_setter(self):
pt.name = 'Prep information 1'
self.assertEqual(pt.name, 'Prep information 1')

def test_current_human_filtering(self):
pt = qdb.metadata_template.prep_template.PrepTemplate(1)
# by default it should be false
self.assertFalse(pt.current_human_filtering)
pt.current_human_filtering = True
self.assertTrue(pt.current_human_filtering)
pt.current_human_filtering = False
self.assertFalse(pt.current_human_filtering)


EXP_PREP_TEMPLATE = (
'sample_name\tbarcode\tcenter_name\tcenter_project_name\t'
Expand Down
4 changes: 4 additions & 0 deletions qiita_db/support_files/patches/92.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ ALTER TABLE qiita.slurm_resource_allocations
ADD CONSTRAINT fk_slurm_resource_allocations
FOREIGN KEY ( processing_job_id )
REFERENCES qiita.processing_job ( processing_job_id );

-- Apr 21, 2024
-- Adding a new column: current_human_filtering to qiita.prep_template
ALTER TABLE qiita.prep_template ADD current_human_filtering boolean DEFAULT False;
7 changes: 5 additions & 2 deletions qiita_db/support_files/qiita-db.dbs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,9 @@
<column name="creation_job_id" type="uuid" jt="1111" >
<defo><![CDATA[NULL]]></defo>
</column>
<column name="current_human_filtering" type="boolean" jt="1111" >
<defo><![CDATA[false]]></defo>
</column>
<index name="pk_prep_template" unique="PRIMARY_KEY" >
<column name="prep_template_id" />
</index>
Expand Down Expand Up @@ -2148,10 +2151,10 @@ $function$
<entity schema="qiita" name="user_level" color="D1BEF4" x="64" y="1520" />
<entity schema="qiita" name="visibility" color="BED3F4" x="2160" y="880" />
<script name="Sample SQL Editor" id="Editor_19ad" language="SQL" >
<string><![CDATA[SELECT artifact_id, generated_timestamp, command_id, command_parameters, visibility_id, artifact_type_id, data_type_id, submitted_to_vamps,
<string><![CDATA[SELECT artifact_id, generated_timestamp, command_id, command_parameters, visibility_id, artifact_type_id, data_type_id, submitted_to_vamps,
name
FROM
qiita.artifact t;]]></string>
</script>
</layout>
</project>
</project>
Loading