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
2 changes: 1 addition & 1 deletion clodius/tiles/cooler.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def make_mats(filepath):

# get the genome size
resolution = list(f["resolutions"].keys())[0]
genome_length = int(sum(f["resolutions"][resolution]["chroms"]["length"]))
genome_length = int(np.sum(f["resolutions"][resolution]["chroms"]["length"][:].astype(np.int64)))

info["max_pos"] = [genome_length, genome_length]
info["min_pos"] = [1, 1]
Expand Down
6 changes: 4 additions & 2 deletions clodius/tiles/cram.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pysam

from clodius.tiles.bam import alignment_tileset_info
from clodius.tiles.bam import alignment_tiles


def tileset_info(filename, chromsizes):
import pysam

samfile = pysam.AlignmentFile(filename, "rc")

return alignment_tileset_info(samfile, chromsizes)
Expand All @@ -13,6 +13,8 @@ def tileset_info(filename, chromsizes):
def tiles(
filename, tile_ids, index_filename=None, chromsizes=None, max_tile_width=None
):
import pysam

samfile = pysam.AlignmentFile(filename, "rc", index_filename=index_filename)

return alignment_tiles(
Expand Down
3 changes: 1 addition & 2 deletions clodius/tiles/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from clodius.utils import TILE_OPTIONS_CHAR



def grouper(n, iterable):
it = iter(iterable)
while True:
Expand Down Expand Up @@ -51,7 +50,7 @@ def regions(filename, chromsizes, offset, limit):
limit: The total number of entries to fetch
"""
from pysam import VariantFile

vcf = VariantFile(filename) # auto-detect input format

fetcher = vcf.fetch()
Expand Down
61 changes: 47 additions & 14 deletions notebooks/Aggregating an array.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand All @@ -15,7 +18,10 @@
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -59,7 +65,10 @@
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -295,7 +304,10 @@
"cell_type": "code",
"execution_count": 186,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -329,7 +341,10 @@
"cell_type": "code",
"execution_count": 190,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -487,7 +502,10 @@
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -627,7 +645,10 @@
"cell_type": "code",
"execution_count": 43,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -1051,7 +1072,10 @@
"cell_type": "code",
"execution_count": 279,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -1145,7 +1169,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"## Example with n x c data"
Expand Down Expand Up @@ -1331,7 +1358,10 @@
"cell_type": "code",
"execution_count": 127,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -1384,15 +1414,18 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -1406,9 +1439,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
"version": "3.10.15"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
31 changes: 23 additions & 8 deletions notebooks/ENSEMBL annotations and RNAseq.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -39,7 +42,10 @@
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand All @@ -50,7 +56,10 @@
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -229,7 +238,10 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": []
Expand All @@ -238,15 +250,18 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -260,9 +275,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
"version": "3.10.15"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
21 changes: 15 additions & 6 deletions notebooks/h37rv gene annotations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"cell_type": "code",
"execution_count": 78,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -209,7 +212,10 @@
"cell_type": "code",
"execution_count": 76,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": [
Expand All @@ -220,15 +226,18 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -242,9 +251,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
"version": "3.10.15"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading