Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if isinstance(df, pd.DataFrame) and len(df) > 0:
if not buffer and not create_dir(path):
return ""
if buffer:
destination = filename
else:
destination = os.path.join(path, filename)
logger.info("Saving {}".format(os.path.relpath(destination)))
if prepend_info:
s = (
"# Generated by snps v{}, https://pypi.org/project/snps/\n"
"# Generated at {} UTC\n".format(
snps.__version__,
datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S"),
)
)
else:
s = ""
s += comment
if "na_rep" not in kwargs:
kwargs["na_rep"] = "--"
if buffer:
destination.write(s)
df.to_csv(destination, **kwargs)
destination.seek(0)
elif atomic:
str
path to file in output directory if SNPs were saved, else empty str
"""
filename = self._filename
if not filename:
filename = "{}_{}{}".format(
clean_str(self._snps._source), self._snps.assembly, ".vcf"
)
comment = (
"##fileformat=VCFv4.2\n"
"##fileDate={}\n"
'##source="{}; snps v{}; https://pypi.org/project/snps/"\n'.format(
datetime.datetime.utcnow().strftime("%Y%m%d"),
self._snps._source,
snps.__version__,
)
)
reference_sequence_chroms = (
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
if isinstance(df, pd.DataFrame) and len(df) > 0:
if not buffer and not create_dir(path):
return ""
if buffer:
destination = filename
else:
destination = os.path.join(path, filename)
logger.info("Saving {}".format(os.path.relpath(destination)))
if prepend_info:
s = (
"# Generated by snps v{}, https://pypi.org/project/snps/\n"
"# Generated at {} UTC\n".format(
snps.__version__,
datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S"),
)
)
else:
s = ""
s += comment
if "na_rep" not in kwargs:
kwargs["na_rep"] = "--"
if buffer:
destination.write(s)
df.to_csv(destination, **kwargs)
destination.seek(0)
elif atomic:
source_suffix = ".rst"
# The master toctree document.
master_doc = "index"
# General information about the project.
project = "snps"
copyright = "2019, Andrew Riha"
author = "Andrew Riha"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = snps.__version__
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]