{ "cells": [ { "cell_type": "markdown", "id": "2949abe4-dfa6-4c4a-a395-a3a1db92b5e7", "metadata": {}, "source": [ "## Create _P.generosa_ tissue-specific lncRNA Expression Matrices\n", "\n", "Use lncRNA GTF to ([from 20230502](https://robertslab.github.io/sams-notebook/2023/05/02/lncRNA-Identification-P.generosa-lncRNAs-using-CPC2-and-bedtools.html)) to determine lncRNA expression.\n", "\n", "#### Notebook relies on:\n", "\n", "- [`stringtie`](https://ccb.jhu.edu/software/stringtie/index.shtml?t=manual)\n", "\n" ] }, { "cell_type": "markdown", "id": "ee0ebae6-d54c-4d18-88bd-3d3456a8b1e6", "metadata": {}, "source": [ "### List computer specs" ] }, { "cell_type": "code", "execution_count": 1, "id": "9f60016c-d6b6-4b6d-86d3-5ee68b55464c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "TODAY'S DATE:\n", "Thu May 4 11:26:22 PDT 2023\n", "------------\n", "\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "No LSB modules are available.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Distributor ID:\tUbuntu\n", "Description:\tUbuntu 18.04.6 LTS\n", "Release:\t18.04\n", "Codename:\tbionic\n", "\n", "------------\n", "HOSTNAME: \n", "raven\n", "\n", "------------\n", "Computer Specs:\n", "\n", "Architecture: x86_64\n", "CPU op-mode(s): 32-bit, 64-bit\n", "Byte Order: Little Endian\n", "CPU(s): 48\n", "On-line CPU(s) list: 0-47\n", "Thread(s) per core: 2\n", "Core(s) per socket: 24\n", "Socket(s): 1\n", "NUMA node(s): 1\n", "Vendor ID: GenuineIntel\n", "CPU family: 6\n", "Model: 85\n", "Model name: Intel(R) Xeon(R) Gold 5220R CPU @ 2.20GHz\n", "Stepping: 7\n", "CPU MHz: 2800.000\n", "CPU max MHz: 4000.0000\n", "CPU min MHz: 1000.0000\n", "BogoMIPS: 4400.00\n", "Virtualization: VT-x\n", "L1d cache: 32K\n", "L1i cache: 32K\n", "L2 cache: 1024K\n", "L3 cache: 36608K\n", "NUMA node0 CPU(s): 0-47\n", "Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke avx512_vnni md_clear flush_l1d arch_capabilities\n", "\n", "------------\n", "\n", "Memory Specs\n", "\n", " total used free shared buff/cache available\n", "Mem: 247G 25G 1.3G 612K 220G 219G\n", "Swap: 99G 390M 99G\n" ] } ], "source": [ "%%bash\n", "echo \"TODAY'S DATE:\"\n", "date\n", "echo \"------------\"\n", "echo \"\"\n", "#Display operating system info\n", "lsb_release -a\n", "echo \"\"\n", "echo \"------------\"\n", "echo \"HOSTNAME: \"; hostname \n", "echo \"\"\n", "echo \"------------\"\n", "echo \"Computer Specs:\"\n", "echo \"\"\n", "lscpu\n", "echo \"\"\n", "echo \"------------\"\n", "echo \"\"\n", "echo \"Memory Specs\"\n", "echo \"\"\n", "free -mh" ] }, { "cell_type": "markdown", "id": "19866f68-bfad-4a83-adb5-24e271e29d06", "metadata": {}, "source": [ "### Set variables\n", "- `%env` indicates a bash variable\n", "\n", "- without `%env` is Python variable" ] }, { "cell_type": "code", "execution_count": 3, "id": "7293bcb0-581c-4ad2-8f1e-09dd98352aaf", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "env: transcriptomes_dir=/home/shared/8TB_HDD_01/sam/data/P_generosa/transcriptomes\n", "env: genomes_dir=/home/shared/8TB_HDD_01/sam/data/P_generosa/genomes\n", "env: analysis_dir=/home/shared/8TB_HDD_01/sam/analyses/20230504-pgen-lncRNA-expression\n", "env: threads=40\n", "env: read_length=130\n", "env: lncRNA_gtf=20230502-pgen-lncRNA-IDs.gtf\n", "env: lncRNA_url=gannet:/volume2/web/Atumefaciens/20230502-pgen-lncRNA-identification\n", "env: sorted_bams_url=gannet:/volume2/web/Atumefaciens/20230426-pgen-HISAT2-stringtie-gffcompare-RNAseq\n", "env: lncRNA_stringtie_gtf=pgen-lncRNA-stringtie.gtf\n", "env: stringtie=/home/shared/stringtie-2.2.1.Linux_x86_64/stringtie\n", "env: prepDE=/home/shared/stringtie-2.2.1.Linux_x86_64/prepDE.py3\n", "env: line=-------------------------------------------------------------------------------------\n" ] } ], "source": [ "# Set directories\n", "%env transcriptomes_dir=/home/shared/8TB_HDD_01/sam/data/P_generosa/transcriptomes\n", "%env genomes_dir=/home/shared/8TB_HDD_01/sam/data/P_generosa/genomes\n", "%env analysis_dir=/home/shared/8TB_HDD_01/sam/analyses/20230504-pgen-lncRNA-expression\n", "analysis_dir=\"20230504-pgen-lncRNA-expression\"\n", "\n", "# CPU threads\n", "%env threads=40\n", "\n", "# Average read length\n", "%env read_length=130\n", "\n", "# Input files\n", "%env lncRNA_gtf=20230502-pgen-lncRNA-IDs.gtf\n", "## lncRNA directory URL\n", "## https://gannet.fish.washington.edu/Atumefaciens/20230502-pgen-lncRNA-identification/\n", "%env lncRNA_url=gannet:/volume2/web/Atumefaciens/20230502-pgen-lncRNA-identification\n", "\n", "## Tissue-specific sorted BAM files directory URL\n", "## https://gannet.fish.washington.edu/Atumefaciens/20230426-pgen-HISAT2-stringtie-gffcompare-RNAseq/\n", "%env sorted_bams_url=gannet:/volume2/web/Atumefaciens/20230426-pgen-HISAT2-stringtie-gffcompare-RNAseq\n", "\n", "\n", "# Output file(s)\n", "%env lncRNA_stringtie_gtf=pgen-lncRNA-stringtie.gtf\n", "\n", "# Set program locations\n", "%env stringtie=/home/shared/stringtie-2.2.1.Linux_x86_64/stringtie\n", "%env prepDE=/home/shared/stringtie-2.2.1.Linux_x86_64/prepDE.py3\n", "\n", "# Line for formatting\n", "%env line=-------------------------------------------------------------------------------------" ] }, { "cell_type": "markdown", "id": "7f204c16-2d1f-4837-93b0-1fb0e3d00d64", "metadata": {}, "source": [ "## Create analysis directories" ] }, { "cell_type": "code", "execution_count": 4, "id": "8f275e34-c56e-4754-abf7-3279667434bb", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "total 20\n", "drwxrwxr-x 2 sam sam 4096 May 4 11:30 ctenidia\n", "drwxrwxr-x 2 sam sam 4096 May 4 11:30 gonad\n", "drwxrwxr-x 2 sam sam 4096 May 4 11:30 heart\n", "drwxrwxr-x 2 sam sam 4096 May 4 11:30 juvenile\n", "drwxrwxr-x 2 sam sam 4096 May 4 11:30 larvae\n" ] } ], "source": [ "%%bash\n", "\n", "declare -a sample_names_array=(ctenidia gonad heart juvenile larvae)\n", "\n", "for sample in \"${sample_names_array[@]}\"\n", "do\n", " # Make analysis and data directory, if doesn't exist\n", " mkdir --parents \"${analysis_dir}/${sample}\"\n", "done\n", "\n", "ls -l \"${analysis_dir}\"" ] }, { "cell_type": "markdown", "id": "56052f6d-441a-4048-8a6f-39d58552283d", "metadata": {}, "source": [ "## Download lncRNA GTF" ] }, { "cell_type": "code", "execution_count": 5, "id": "951fc8e9-b821-4f54-848f-f9573daadc83", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "X11 forwarding request failed on channel 0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "-rw-rw-r-- 1 sam sam 2.2M May 4 11:30 20230502-pgen-lncRNA-IDs.gtf\n" ] } ], "source": [ "%%bash\n", "cd \"${transcriptomes_dir}\"\n", "\n", "rsync \"${lncRNA_url}/${lncRNA_gtf}\" .\n", "\n", "\n", "ls -ltrh \"${lncRNA_gtf}\"" ] }, { "cell_type": "markdown", "id": "e50df042-59c0-4327-b3a4-f14399eba05f", "metadata": {}, "source": [ "### Inspect GTF" ] }, { "cell_type": "code", "execution_count": 6, "id": "98a870cf-518f-44e5-8c7a-eb32c219ea68", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scaffold_01\tStringTie\ttranscript\t656906\t657583\t.\t+\t.\ttranscript_id \"MSTRG.38.5\"; gene_id \"MSTRG.38\"; xloc \"XLOC_000013\"; class_code \"u\"; tss_id \"TSS19\";\n", "Scaffold_01\tStringTie\ttranscript\t648204\t649326\t.\t+\t.\ttranscript_id \"MSTRG.39.1\"; gene_id \"MSTRG.39\"; xloc \"XLOC_000014\"; class_code \"u\"; tss_id \"TSS20\";\n", "Scaffold_01\tStringTie\ttranscript\t849165\t854552\t.\t+\t.\ttranscript_id \"MSTRG.63.1\"; gene_id \"MSTRG.63\"; xloc \"XLOC_000019\"; class_code \"u\"; tss_id \"TSS25\";\n", "Scaffold_01\tStringTie\ttranscript\t852049\t854552\t.\t+\t.\ttranscript_id \"MSTRG.63.2\"; gene_id \"MSTRG.63\"; xloc \"XLOC_000019\"; class_code \"u\"; tss_id \"TSS26\";\n", "Scaffold_01\tStringTie\ttranscript\t862415\t867481\t.\t+\t.\ttranscript_id \"MSTRG.66.1\"; gene_id \"MSTRG.66\"; xloc \"XLOC_000020\"; class_code \"u\"; tss_id \"TSS27\";\n", "Scaffold_01\tStringTie\ttranscript\t1824775\t1828291\t.\t+\t.\ttranscript_id \"MSTRG.109.1\"; gene_id \"MSTRG.109\"; xloc \"XLOC_000040\"; class_code \"u\"; tss_id \"TSS56\";\n", "Scaffold_01\tStringTie\ttranscript\t1966694\t1970033\t.\t+\t.\ttranscript_id \"MSTRG.121.2\"; gene_id \"MSTRG.121\"; xloc \"XLOC_000044\"; class_code \"u\"; tss_id \"TSS62\";\n", "Scaffold_01\tStringTie\ttranscript\t1966694\t1970033\t.\t+\t.\ttranscript_id \"MSTRG.121.1\"; gene_id \"MSTRG.121\"; xloc \"XLOC_000044\"; class_code \"u\"; tss_id \"TSS62\";\n", "Scaffold_01\tStringTie\ttranscript\t2318317\t2328097\t.\t+\t.\ttranscript_id \"MSTRG.137.3\"; gene_id \"MSTRG.137\"; xloc \"XLOC_000053\"; class_code \"u\"; tss_id \"TSS72\";\n", "Scaffold_01\tStringTie\ttranscript\t2843989\t2844204\t.\t+\t.\ttranscript_id \"MSTRG.169.1\"; gene_id \"MSTRG.169\"; xloc \"XLOC_000070\"; class_code \"u\"; tss_id \"TSS92\";\n", "\n", "-------------------------------------------------------------------------------------\n", "\n", "Number of lines:\n", "13606 /home/shared/8TB_HDD_01/sam/data/P_generosa/transcriptomes/20230502-pgen-lncRNA-IDs.gtf\n" ] } ], "source": [ "%%bash\n", "head \"${transcriptomes_dir}/${lncRNA_gtf}\"\n", "\n", "echo \"\"\n", "echo \"${line}\"\n", "echo \"\"\n", "\n", "echo \"Number of lines:\"\n", "wc -l \"${transcriptomes_dir}/\"*.gtf" ] }, { "cell_type": "markdown", "id": "ec9a917a-f92b-4b47-9132-e74d3e796e23", "metadata": {}, "source": [ "## Download tissue-specific BAM files" ] }, { "cell_type": "code", "execution_count": 7, "id": "2ed44d78-7fa4-48ed-a180-1c7df083f4ca", "metadata": { "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "X11 forwarding request failed on channel 0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "receiving incremental file list\n", "\n", "sent 20 bytes received 73 bytes 186.00 bytes/sec\n", "total size is 6,754,114,204 speedup is 72,624,883.91\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "X11 forwarding request failed on channel 0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "receiving incremental file list\n", "\n", "sent 20 bytes received 69 bytes 178.00 bytes/sec\n", "total size is 6,797,749,344 speedup is 76,379,206.11\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "X11 forwarding request failed on channel 0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "receiving incremental file list\n", "\n", "sent 20 bytes received 70 bytes 180.00 bytes/sec\n", "total size is 12,798,127,359 speedup is 142,201,415.10\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "X11 forwarding request failed on channel 0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "receiving incremental file list\n", "\n", "sent 20 bytes received 72 bytes 61.33 bytes/sec\n", "total size is 40,853,337,318 speedup is 444,058,014.33\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "X11 forwarding request failed on channel 0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "receiving incremental file list\n", "\n", "sent 20 bytes received 71 bytes 182.00 bytes/sec\n", "total size is 8,476,545,854 speedup is 93,148,855.54\n", ".\n", "├── [2.1M] 20230502-pgen-lncRNA-IDs.gtf\n", "├── [4.0K] ctenidia\n", "│   └── [6.3G] ctenidia.sorted.bam\n", "├── [4.0K] gonad\n", "│   └── [6.3G] gonad.sorted.bam\n", "├── [4.0K] heart\n", "│   └── [ 12G] heart.sorted.bam\n", "├── [4.0K] juvenile\n", "│   └── [ 38G] juvenile.sorted.bam\n", "└── [4.0K] larvae\n", " └── [7.9G] larvae.sorted.bam\n", "\n", "5 directories, 6 files\n" ] } ], "source": [ "%%bash\n", "declare -a sample_names_array=(ctenidia gonad heart juvenile larvae)\n", "cd \"${transcriptomes_dir}\"\n", "\n", "for sample in \"${sample_names_array[@]}\"\n", "do\n", " rsync -avP \"${sorted_bams_url}/${sample}/*.bam\" ./\"${sample}\"/\n", "done\n", "\n", "\n", "tree -h" ] }, { "cell_type": "markdown", "id": "637b3c3c-023c-4a90-8e93-6a0ed2f39e60", "metadata": {}, "source": [ "## Run StingTie to calculate expression values" ] }, { "cell_type": "code", "execution_count": 8, "id": "f48f3d35-497d-40c8-94ac-f83e4f45ea92", "metadata": { "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\n", "real\t26m57.746s\n", "user\t26m26.461s\n", "sys\t1m47.458s\n" ] } ], "source": [ "%%bash\n", "declare -a sample_names_array=(ctenidia gonad heart juvenile larvae)\n", "cd \"${transcriptomes_dir}\"\n", "\n", "time \\\n", "for sample in \"${sample_names_array[@]}\"\n", "do\n", " \"${stringtie}\" \\\n", " -G \"${lncRNA_gtf}\" \\\n", " -e \"${sample}/${sample}.sorted.bam\" \\\n", " -B \\\n", " -o \"${analysis_dir}/${sample}/${sample}-${lncRNA_stringtie_gtf}\" \\\n", " -p \"${threads}\"\n", "done" ] }, { "cell_type": "markdown", "id": "ab669ae2-08c9-43cc-8c9a-55d066a23dbb", "metadata": {}, "source": [ "### Inspect Ballgown `t_data.ctab` files" ] }, { "cell_type": "code", "execution_count": 9, "id": "1c6441da-fc23-4939-b6d2-210ddb851335", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "==> ctenidia/t_data.ctab <==\n", "t_id chr strand start end t_name num_exons length gene_id gene_name cov FPKM\n", "1 Scaffold_01 . 11047 11352 MSTRG.1.1 1 306 MSTRG.1 . 14.054919 12.378725\n", "2 Scaffold_01 . 112427 112635 MSTRG.2.1 1 209 MSTRG.2 . 10.762517 9.478975\n", "3 Scaffold_01 . 144700 145155 MSTRG.3.1 1 456 MSTRG.3 . 4.171104 3.673657\n", "4 Scaffold_01 . 287989 288219 MSTRG.22.1 1 231 MSTRG.22 . 1.844156 1.624221\n", "5 Scaffold_01 - 315962 318697 MSTRG.9.1 1 2736 MSTRG.9 . 0.137427 0.121037\n", "6 Scaffold_01 - 338904 343505 MSTRG.11.1 1 4602 MSTRG.11 . 2.484985 2.188625\n", "7 Scaffold_01 - 340163 341929 MSTRG.12.1 1 1767 MSTRG.12 . 0.177377 0.156223\n", "8 Scaffold_01 . 393353 393579 MSTRG.25.1 1 227 MSTRG.25 . 3.229075 2.843974\n", "9 Scaffold_01 . 394186 394835 MSTRG.27.1 1 650 MSTRG.27 . 0.654920 0.576814\n", "==> gonad/t_data.ctab <==\n", "t_id chr strand start end t_name num_exons length gene_id gene_name cov FPKM\n", "1 Scaffold_01 . 11047 11352 MSTRG.1.1 1 306 MSTRG.1 . 6.550655 5.356400\n", "2 Scaffold_01 . 112427 112635 MSTRG.2.1 1 209 MSTRG.2 . 2.580743 2.110246\n", "3 Scaffold_01 . 144700 145155 MSTRG.3.1 1 456 MSTRG.3 . 2.520470 2.060961\n", "4 Scaffold_01 . 287989 288219 MSTRG.22.1 1 231 MSTRG.22 . 13.246754 10.831728\n", "5 Scaffold_01 - 315962 318697 MSTRG.9.1 1 2736 MSTRG.9 . 6.287646 5.141340\n", "6 Scaffold_01 - 338904 343505 MSTRG.11.1 1 4602 MSTRG.11 . 3.458437 2.827927\n", "7 Scaffold_01 - 340163 341929 MSTRG.12.1 1 1767 MSTRG.12 . 5.887366 4.814035\n", "8 Scaffold_01 . 393353 393579 MSTRG.25.1 1 227 MSTRG.25 . 26.885462 21.983952\n", "9 Scaffold_01 . 394186 394835 MSTRG.27.1 1 650 MSTRG.27 . 15.623077 12.774822\n", "==> heart/t_data.ctab <==\n", "t_id chr strand start end t_name num_exons length gene_id gene_name cov FPKM\n", "1 Scaffold_01 . 11047 11352 MSTRG.1.1 1 306 MSTRG.1 . 5.109694 3.473269\n", "2 Scaffold_01 . 112427 112635 MSTRG.2.1 1 209 MSTRG.2 . 0.934429 0.635170\n", "3 Scaffold_01 . 144700 145155 MSTRG.3.1 1 456 MSTRG.3 . 13.572083 9.225503\n", "4 Scaffold_01 . 287989 288219 MSTRG.22.1 1 231 MSTRG.22 . 3.380952 2.298172\n", "5 Scaffold_01 - 315962 318697 MSTRG.9.1 1 2736 MSTRG.9 . 0.028874 0.019627\n", "6 Scaffold_01 - 338904 343505 MSTRG.11.1 1 4602 MSTRG.11 . 2.168446 1.473982\n", "7 Scaffold_01 - 340163 341929 MSTRG.12.1 1 1767 MSTRG.12 . 0.827503 0.562488\n", "8 Scaffold_01 . 393353 393579 MSTRG.25.1 1 227 MSTRG.25 . 4.281939 2.910610\n", "9 Scaffold_01 . 394186 394835 MSTRG.27.1 1 650 MSTRG.27 . 1.744719 1.185957\n", "==> juvenile/t_data.ctab <==\n", "t_id chr strand start end t_name num_exons length gene_id gene_name cov FPKM\n", "1 Scaffold_01 . 11047 11352 MSTRG.1.1 1 306 MSTRG.1 . 39.284966 7.956386\n", "2 Scaffold_01 . 112427 112635 MSTRG.2.1 1 209 MSTRG.2 . 5.129220 1.038821\n", "3 Scaffold_01 . 144700 145155 MSTRG.3.1 1 456 MSTRG.3 . 48.703339 9.863890\n", "4 Scaffold_01 . 287989 288219 MSTRG.22.1 1 231 MSTRG.22 . 15.121211 3.062500\n", "5 Scaffold_01 - 315962 318697 MSTRG.9.1 1 2736 MSTRG.9 . 79.854469 16.172930\n", "6 Scaffold_01 - 338904 343505 MSTRG.11.1 1 4602 MSTRG.11 . 4.064149 0.823112\n", "7 Scaffold_01 - 340163 341929 MSTRG.12.1 1 1767 MSTRG.12 . 3.399209 0.688442\n", "8 Scaffold_01 . 393353 393579 MSTRG.25.1 1 227 MSTRG.25 . 0.000000 0.000000\n", "9 Scaffold_01 . 394186 394835 MSTRG.27.1 1 650 MSTRG.27 . 2.226039 0.450840\n", "==> larvae/t_data.ctab <==\n", "t_id chr strand start end t_name num_exons length gene_id gene_name cov FPKM\n", "1 Scaffold_01 . 11047 11352 MSTRG.1.1 1 306 MSTRG.1 . 2.543795 2.304948\n", "2 Scaffold_01 . 112427 112635 MSTRG.2.1 1 209 MSTRG.2 . 0.886656 0.803404\n", "3 Scaffold_01 . 144700 145155 MSTRG.3.1 1 456 MSTRG.3 . 17.080650 15.476877\n", "4 Scaffold_01 . 287989 288219 MSTRG.22.1 1 231 MSTRG.22 . 12.000000 10.873270\n", "5 Scaffold_01 - 315962 318697 MSTRG.9.1 1 2736 MSTRG.9 . 11.628655 10.536793\n", "6 Scaffold_01 - 338904 343505 MSTRG.11.1 1 4602 MSTRG.11 . 2.655371 2.406047\n", "7 Scaffold_01 - 340163 341929 MSTRG.12.1 1 1767 MSTRG.12 . 3.663328 3.319363\n", "8 Scaffold_01 . 393353 393579 MSTRG.25.1 1 227 MSTRG.25 . 0.502203 0.455049\n", "9 Scaffold_01 . 394186 394835 MSTRG.27.1 1 650 MSTRG.27 . 0.689231 0.624516\n" ] } ], "source": [ "%%bash\n", "declare -a sample_names_array=(ctenidia gonad heart juvenile larvae)\n", "cd \"${analysis_dir}\"\n", "\n", "for sample in \"${sample_names_array[@]}\"\n", "do\n", " head --verbose \"${sample}/t_data.ctab\" | column -t\n", "done" ] }, { "cell_type": "markdown", "id": "2d4d6317-352d-449f-ac29-77ffe9566112", "metadata": {}, "source": [ "## Create count matrix" ] }, { "cell_type": "code", "execution_count": 10, "id": "5d1930f1-4491-4094-974a-9547103dea3d", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "total 752K\n", "drwxrwxr-x 2 sam sam 4.0K May 4 11:34 ctenidia\n", "drwxrwxr-x 2 sam sam 4.0K May 4 11:37 gonad\n", "drwxrwxr-x 2 sam sam 4.0K May 4 11:41 heart\n", "drwxrwxr-x 2 sam sam 4.0K May 4 11:55 juvenile\n", "drwxrwxr-x 2 sam sam 4.0K May 4 11:58 larvae\n", "-rw-rw-r-- 1 sam sam 409K May 4 11:58 transcript_count_matrix.csv\n", "-rw-rw-r-- 1 sam sam 317K May 4 11:58 gene_count_matrix.csv\n" ] } ], "source": [ "%%bash\n", "cd \"${analysis_dir}\"\n", "\n", "\"${prepDE}\" \\\n", "-l \"${read_length}\"\n", "\n", "ls -ltrh" ] }, { "cell_type": "markdown", "id": "ceff8a56-6d78-4a75-ab3b-a1acaffbe370", "metadata": {}, "source": [ "### Inspect transcript counts" ] }, { "cell_type": "code", "execution_count": 11, "id": "e4f3efff-b21a-4493-87a8-3aa553ffb5a7", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "transcript_id ctenidia gonad heart juvenile larvae\n", "MSTRG.1.1 34 16 13 93 6\n", "MSTRG.2.1 18 5 2 9 2\n", "MSTRG.3.1 15 9 48 171 60\n", "MSTRG.22.1 4 24 7 27 22\n", "MSTRG.9.1 3 133 1 1681 245\n", "MSTRG.11.1 88 123 77 144 95\n", "MSTRG.12.1 3 81 12 47 50\n", "MSTRG.25.1 6 47 8 0 1\n", "MSTRG.27.1 4 79 9 12 4\n", "\n", "-------------------------------------------------------------------------------------\n", "\n", "13607 transcript_count_matrix.csv\n" ] } ], "source": [ "%%bash\n", "cd \"${analysis_dir}\"\n", "\n", "head transcript_count_matrix.csv | column -t -s \",\"\n", "\n", "echo \"\"\n", "echo \"${line}\"\n", "echo \"\"\n", "\n", "wc -l transcript_count_matrix.csv" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.10" } }, "nbformat": 4, "nbformat_minor": 5 }