Skip to content

Commit

Permalink
Change output path names to unphased suffix in SNPObj.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
miriambt committed Nov 15, 2024
1 parent f145ea7 commit c69d673
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions demos/SNPObj.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 29,
"id": "544b2955",
"metadata": {},
"outputs": [
Expand All @@ -799,14 +799,14 @@
"output_type": "stream",
"text": [
"SNPObject saved to ../data/output.vcf\n",
"SNPObject saved to ../data/output.phased\n"
"SNPObject saved to ../data/output.unphased\n"
]
}
],
"source": [
"# Define the path to save the VCF file\n",
"output_vcf_path1 = '../data/output.vcf'\n",
"output_vcf_path2 = '../data/output.phased'\n",
"output_vcf_path2 = '../data/output.unphased'\n",
"\n",
"# Save the SNPObject as a VCF file (Option 1)\n",
"snpobj.save(output_vcf_path1)\n",
Expand All @@ -827,35 +827,29 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 30,
"id": "08eff0b2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"INFO:snputils.snp.io.write.pgen:Writing to ../data/output.pvar\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"INFO:snputils.snp.io.write.pgen:Writing to ../data/output.pvar\n",
"INFO:snputils.snp.io.write.pgen:Writing ../data/output.psam\n",
"INFO:snputils.snp.io.write.pgen:Writing to ../data/output.pgen\n",
"SNPObject saved to ../data/output.pgen\n",
"INFO:snputils.snp.io.write.pgen:Writing to ../data/output.phased.pvar\n",
"INFO:snputils.snp.io.write.pgen:Writing ../data/output.phased.psam\n",
"INFO:snputils.snp.io.write.pgen:Writing to ../data/output.phased.pgen\n",
"SNPObject saved to ../data/output.phased\n"
"INFO:snputils.snp.io.write.pgen:Writing to ../data/output.unphased.pvar\n",
"INFO:snputils.snp.io.write.pgen:Writing ../data/output.unphased.psam\n",
"INFO:snputils.snp.io.write.pgen:Writing to ../data/output.unphased.pgen\n",
"SNPObject saved to ../data/output.unphased\n"
]
}
],
"source": [
"# Define the path to save the BED file\n",
"output_pgen_path1 = '../data/output.pgen'\n",
"output_pgen_path2 = '../data/output.phased'\n",
"output_pgen_path2 = '../data/output.unphased'\n",
"\n",
"# Save the SNPObject as a PGEN file (option 1)\n",
"snpobj.save(output_pgen_path1)\n",
Expand All @@ -876,7 +870,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 31,
"id": "fbca1fd8",
"metadata": {},
"outputs": [
Expand All @@ -899,14 +893,14 @@
"INFO:snputils.snp.io.write.bed:Writing .bim file: ../data/output\n",
"WARNING:snputils.snp.io.write.bed:The .bim file is being saved with 0 cM values.\n",
"INFO:snputils.snp.io.write.bed:Finished writing .bim file: ../data/output\n",
"SNPObject saved to ../data/output.phased\n"
"SNPObject saved to ../data/output.unphased\n"
]
}
],
"source": [
"# Define the path to save the BED file\n",
"output_bed_path1 = '../data/output.bed'\n",
"output_bed_path2 = '../data/output.phased'\n",
"output_bed_path2 = '../data/output.unphased'\n",
"\n",
"# Save the SNPObject as a BED file (option 1)\n",
"snpobj.save(output_bed_path1)\n",
Expand All @@ -927,26 +921,31 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 33,
"id": "cea856ad",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"SNPObject saved to ../data/output.pkl\n"
"SNPObject saved to ../data/output.pkl\n",
"SNPObject saved to ../data/output.unphased\n"
]
}
],
"source": [
"# Define the path to save the pickle file\n",
"output_pkl_path = '../data/output.pkl'\n",
"output_pkl_path1 = '../data/output.pkl'\n",
"output_pkl_path2 = '../data/output.unphased'\n",
"\n",
"# Save the SNPObject as a pickle file\n",
"snpobj.save(output_pkl_path)\n",
"# Save the SNPObject as a pickle file (option 1)\n",
"snpobj.save(output_pkl_path1)\n",
"print(f\"SNPObject saved to {output_pkl_path1}\")\n",
"\n",
"print(f\"SNPObject saved to {output_pkl_path}\")"
"# Save the SNPObject as a pickle file (option 2)\n",
"snpobj.save_pickle(output_pkl_path2)\n",
"print(f\"SNPObject saved to {output_pkl_path2}\")"
]
},
{
Expand Down

0 comments on commit c69d673

Please sign in to comment.