Giter Site home page Giter Site logo

star8521 / chemsharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jenskrumsieck/chemsharp

0.0 0.0 0.0 3.38 MB

Library for processing of chemistry related files (aiming at spectroscopy and structural files)

License: MIT License

C# 98.28% TypeScript 1.36% JavaScript 0.36%

chemsharp's Introduction

ChemSharp

.NET Library for processing of chemistry related files. Powers PorphyStruct!

Maintainability .NET GitHub issues GitHub commit activity GitHub license GitHub tag (latest by date) DOI


NuGet Packages

ChemSharp NuGet Badge
ChemSharp.Molecules NuGet Badge
ChemSharp.Molecules.Blazor NuGet Badge
ChemSharp.Spectroscopy NuGet Badge
ChemSharp.UnitConversion NuGet Badge

CI Releases at: GitHub Packages

Features

Basic Usage

Create Molecules

Molecules can be created in a lot of ways. The easiest way is to use MoleculeFactory.Create, which accepts a string path. Depending on the File extension the correct DataProvider is used to load the file.

//Creates a molecule from cif file
const string path = "files/cif.cif";
var mol = MoleculeFactory.Create(path);

It is also possible to create a Molecule by using a specific DataProvider (e.g. if automatic detection fails or you only want to support a selected number of file types)

//You can also create molecules by selecting the provider yourself
const string path = "files/benzene.mol2";
var provider = new Mol2DataProvider(path);
var mol = new Molecule(provider);

You can also add Atoms and Bonds as Lists if you got the data from somewhere else.

//...or by just adding the Atoms & Bonds as Lists
const string path = "files/cif.cif";
var provider = new CIFDataProvider(path);
var mol = new Molecule(provider.Atoms, provider.Bonds);

Create Spectra

Spectra can be created in a lot of ways. The easiest way is to use SpectrumFactory.Create, which accepts a string path. Depending on the File extension the correct DataProvider is used to load the file.

//Creates an UV/Vis Spectrum
const string path = "files/uvvis.dsw";
var uvvis = SpectrumFactory.Create(path);

It is also possible to create a Spectrum by using a specific DataProvider (e.g. if automatic detection fails or you only want to support a selected number of file types)

//You can also create spectra by choosing the provider 
//explicitly. e.g. csv files
//Reads in an CSV Spectrum (first data only)
const string path = "files/uvvis.csv";
var prov = new GenericCSVProvider(path);
var uvvis = new Spectrum(prov);

There is also the MultiCSVProvider which can provide data from multiple XY pairs in a csv file

//To read in all CSV Data stored as (X,Y) pairs use the MultiCSVProvider
//Each Spectrum will be stored as DataPoint[] in MultiXYData
const string file = "files/multicsv.csv";
var provider = new MultiCSVProvider(file);

Supported Filetypes

  • Molecule

    • Import (XYZ, CIF (crystallographic information file, CCDC), MOL2 (TRIPOS Mol2), PDB (Protein Data Bank file), CDXML (Single Molecule only))
    • Export (XYZ, MOL2)
  • Spectroscopy

    • Import (Varian/Agilient DSW, Bruker EMX SPC/PAR, Bruker TopSpin (fid, (1r/1i processed spectra), JCAMP-DX (acqus, procs, ...)), CSV)
    • Export (CSV)

Used Libraries:

Compatibility

  • .NET Standard 2.0, .NET Standard 2.1, .NET 5, .NET 6
  • Unity (see Wiki )
  • Godot Engine (see Wiki for Snippet)
  • Blazor (see ChemSharp.Molecules.Blazor)

Used by (Highlights):

chemsharp's People

Contributors

jenskrumsieck avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.