-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove incomplete comments * Fix dirname errors when getting the script directory Also, it’d be nice to load this function from a common file, but to locate that file robustly we’d need the scripts directory in the first place :) * Reword comments * Fix typos * Rewrite documentation * Replace fixture-generating scripts, starting now from cell groups * Apply suggestions from PR * Guarantee that at least one cell of Not available cell type is included * Require argument of the selected K in each experiment, as some tests are precisely about this feature * Update automatic tests service from Travis to GH Actions * Address clarity issues in README after PR review * Address clarity issues in fixtures README after PR review * few README edits * Fix typo in script * Fix typo in comment Co-authored-by: Pedro Madrigal <[email protected]>
- Loading branch information
1 parent
8c55e9d
commit 3d64dc2
Showing
33 changed files
with
507 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Arguments: | ||
# Experiment accession | ||
# Selected k | ||
psql -q -U ${POSTGRES_USER} -d ${POSTGRES_DB} -h ${POSTGRES_HOST} << EOF | ||
COPY ( | ||
SELECT | ||
* | ||
FROM | ||
scxa_cell_group scg | ||
WHERE | ||
scg.experiment_accession = '${1}' | ||
AND | ||
scg.variable IN ( | ||
(SELECT variable FROM scxa_cell_group WHERE variable='${2}') | ||
UNION | ||
(SELECT * FROM ( | ||
SELECT | ||
DISTINCT cg.variable | ||
FROM | ||
scxa_cell_group cg | ||
INNER JOIN | ||
scxa_cell_group_marker_genes cgmg | ||
ON | ||
cg.id = cgmg.cell_group_id | ||
WHERE | ||
cg.experiment_accession='${1}' | ||
AND | ||
cg.variable ~ '^[12]' | ||
AND | ||
cgmg.marker_probability < 0.05 | ||
) low_clustering_with_marker_genes | ||
ORDER BY random() | ||
LIMIT 2) | ||
UNION | ||
(SELECT * FROM ( | ||
SELECT | ||
DISTINCT cg.variable | ||
FROM | ||
scxa_cell_group cg | ||
INNER JOIN | ||
scxa_cell_group_marker_genes cgmg | ||
ON | ||
cg.id = cgmg.cell_group_id | ||
WHERE | ||
cg.experiment_accession='${1}' | ||
AND | ||
cg.variable ~ 'inferred cell type' | ||
AND | ||
cgmg.marker_probability < 0.05 | ||
) cell_types_with_marker_genes | ||
ORDER BY random() | ||
LIMIT 1)) | ||
) TO STDOUT DELIMITER E'\t'; | ||
EOF |
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
fixtures/02-scxa-cell-group-marker-genes-right-join-scxa-cell-group-marker-gene-stats.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Arguments: | ||
# List of cell group IDs separated with commas | ||
# Number of marker genes per group (defaults to 5) | ||
psql -q -U ${POSTGRES_USER} -d ${POSTGRES_DB} -h ${POSTGRES_HOST} << EOF | ||
DROP FUNCTION IF EXISTS sample_cell_group_marker_genes_by_cell_group_id; | ||
CREATE FUNCTION sample_cell_group_marker_genes_by_cell_group_id(cell_group_ids int[], lim int) | ||
RETURNS TABLE (cgmg_id integer, cgmg_gene_id varchar, cgmg_cell_group_id integer, cgmg_marker_probability double precision, | ||
cgmgs_gene_id varchar, cgmgs_cell_group_id integer, cgmgs_marker_id integer, cgmgs_expression_type smallint, cgmgs_mean_expression double precision, cgmgs_median_expression double precision) AS | ||
\$\$ | ||
DECLARE | ||
cgi int; | ||
BEGIN | ||
FOREACH cgi IN ARRAY cell_group_ids | ||
LOOP | ||
RETURN QUERY | ||
SELECT | ||
cgmg.*, | ||
cgmgs.* | ||
FROM | ||
scxa_cell_group_marker_genes cgmg | ||
RIGHT JOIN | ||
scxa_cell_group_marker_gene_stats cgmgs | ||
ON | ||
cgmg.id = cgmgs.marker_id | ||
AND | ||
cgmg.gene_id = cgmgs.gene_id | ||
AND | ||
cgmg.cell_group_id = cgmgs.cell_group_id | ||
WHERE | ||
cgmg.cell_group_id = cgi | ||
AND | ||
cgmg.marker_probability < 0.05 | ||
ORDER BY random() | ||
LIMIT lim; | ||
END LOOP; | ||
END; | ||
\$\$ LANGUAGE plpgsql; | ||
COPY ( | ||
SELECT | ||
* | ||
FROM | ||
sample_cell_group_marker_genes_by_cell_group_id(ARRAY[${1}], ${2:-5}) | ||
ORDER BY | ||
cgmg_id | ||
) TO STDOUT DELIMITER E'\t'; | ||
DROP FUNCTION sample_cell_group_marker_genes_by_cell_group_id; | ||
EOF |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Arguments: | ||
# List of cell group IDs separated with commas | ||
# Number of cell IDs per group (defaults to 10) | ||
# Number of cell IDs in not available group (defaults to 10) | ||
psql -q -U ${POSTGRES_USER} -d ${POSTGRES_DB} -h ${POSTGRES_HOST} << EOF | ||
COPY ( | ||
SELECT | ||
* | ||
FROM | ||
scxa_cell_group_membership | ||
WHERE | ||
cell_group_id = ANY(ARRAY[${1}]) | ||
AND | ||
cell_id = ANY( | ||
SELECT * FROM ( | ||
SELECT | ||
DISTINCT(cgm.cell_id) | ||
FROM | ||
scxa_cell_group_membership cgm | ||
WHERE | ||
cgm.cell_group_id = ANY(ARRAY[${1}]) | ||
) cell_ids | ||
ORDER BY RANDOM() | ||
LIMIT ${2:-10}) | ||
UNION | ||
SELECT | ||
* | ||
FROM | ||
scxa_cell_group_membership | ||
WHERE | ||
cell_group_id = ANY(ARRAY[${1}]) | ||
AND | ||
cell_id = ANY( | ||
SELECT * FROM ( | ||
SELECT | ||
DISTINCT(cgm.cell_id) | ||
FROM | ||
scxa_cell_group_membership cgm | ||
JOIN | ||
scxa_cell_group cg | ||
ON | ||
cgm.cell_group_id=cg.id | ||
WHERE | ||
cg.id = ANY(ARRAY[${1}]) | ||
AND | ||
cg.value ~* 'not available' | ||
) cell_ids | ||
ORDER BY RANDOM() | ||
LIMIT ${3:-10}) | ||
) TO STDOUT DELIMITER E'\t'; | ||
EOF |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.