Skip to content
Snippets Groups Projects
Commit 3e028b7c authored by Paul Kühnel's avatar Paul Kühnel
Browse files

test automatic documentation with Sphinx

parent 2abf64c8
No related branches found
No related tags found
1 merge request!1Dev
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
if "%1" == "" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
File moved
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'Autoencoder BigData_Praktikum'
copyright = '2023, Franziska Roepke, Harpreet Int-Veen, Paul Kühnel'
author = 'Franziska Roepke, Harpreet Int-Veen, Paul Kühnel'
release = '0.1'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = ['sphinx.ext.todo',
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary']
templates_path = ['_templates']
exclude_patterns = ['_build', '*.loom', '.DS_Store']
source_suffix = ['.rst', '.md']
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'alabaster'
html_static_path = ['_static']
.. Autoencoder BigData_Praktikum documentation master file, created by
sphinx-quickstart on Fri May 26 14:36:45 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Autoencoder BigData_Praktikum's documentation!
=========================================================
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
.. note::
This project is under active development.
Development
===========
Notes
-----
Some notes during development:
.. toctree::
Notizen
Main documentation
==================
See API
API
===
.. autosummary::
:toctree: generated
main_methods
import loompy
import pandas as pd
import os
def loom_to_pandas_df(file_name="testfiles/test.loom"):
"""
:param file_name: the name of the loom file (default is: "testfiles/test.loom")
:param file_name: the name of the loom file (default is:
"testfiles/test.loom")
:return: pandas DataFrame
"""
df = pd.DataFrame # Empty DataFrame - to return in case of wrong formatting
if file_name[-4:] != ".loom":
if file_name[-5:] != ".loom":
print(f"{file_name} is not a valid file name. Only use '.loom' files!")
with loompy.connect(file_name) as ds:
try:
df = pd.DataFrame(data=ds[:, :], index=ds.ra.Gene, columns=ds.ca.input_name)
df = pd.DataFrame(data=ds[:, :],
index=ds.ra.Gene,
columns=ds.ca.input_name)
except AttributeError or ValueError or OSError:
raise Exception(f"The loom file {file_name} does not exist or has no valid format!")
raise Exception(f"The loom file {file_name} does not exist or has "
f"no valid format!")
return df
print(os.getcwd())
os.chdir("testfiles")
print(os.getcwd())
# print(os.listdir())
test_df = loom_to_pandas_df("AllelicExpressionPatterns-mouse-brain-SS2.loom")
test_df.info()
test_df.describe()
print(".........")
print(test_df)
import loompy
import pandas as pd
ds = loompy.connect("test.loom")
df = pd.DataFrame(data=ds[:, :], index=ds.ra.Gene, columns=ds.ca.input_name)
ds.close()
with loompy.connect("AllelicExpressionPatterns-mouse-brain-SS2.loom") as ds:
df.info()
df.describe()
\ No newline at end of file
#print(ds.ra.Gene)
print(ds.ca.input_name)
print(ds[0:10, 0:10])
#ds = loompy.connect("test.loom")
#df = pd.DataFrame(data=ds[:, :], index=ds.ra.Gene, columns=ds.ca.input_name)
#ds.close()
#df.info()
#df.describe()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment