Bio

02 Scoring von Alignments

Einführung in die Bioinformatik Vorbereiten der Software Grundlagen der objektorientierten Programmierung Einfaches Codebeispiel – manipulieren eines strings Referenzieren einzelner Zeichen in einem string Generieren einer zufälligen Aminosäure-Sequenz Scoring von Alignments Prüfen auf Identität Bewerten von Mutationen – Substitution Matrix Bewerten eines Alignments Der Needleman-Wunsch-Algorithmus Die F-Matrix (abstrakt) Auswählen des Alignments (abstrakt) F-Matrix (Code) Auswählen des Alignments (Code) — coming soon Prüfen auf Identität Die einfachste Art, zwei Sequenzen miteinander zu vergleichen ist, zu prüfen, ob sie identisch sind. Dazu müssen jeweils die 0. Position der ersten Sequenz mit der 0. Position der zweiten, die 1. der ersten mit der 1. der zweiten und so weiter vergleichen werden: Der folgende Code macht genau das gleiche, verwendet dabei jedoch statt einer for-Schleife eine while-Schleife: Das Ergebnis einer solchen Prüfung kann offensichtlich nur zwei Werte annehmen: true oder false. Sowohl Mutationen, als auch Rasterverschiebungen führen bei dieser Methode zu einem ‘false‘: APFELSAFT APPELSAFT…

Bio

01 Einführung in die Bioinformatik

Gerade Biologen/Biotechnologen ohne Vorkenntnisse aus der Informatik, haben oft Probleme beim Verständnis grundlegender Verfahren der Bioinformatik. In einer kleinen Serie von Tutorials, werde ich versuchen, dieser Zielgruppe den Einstieg zu erleichtern. Die Codebeispiele folgen der Syntax der Programmiersprache C#, die abstrakten Verfahren können aber auf andere objektorientierte Programmiersprachen übertragen werden. (z.B. Java, C++, VisualBasic…) Die Theorie zu lesen ist zwar schön und gut, doch am Besten verstehen, was vor sich geht kann man, indem man es selbst macht. Ich empfehle jedem, die Codebeispiele nachzubauen, bzw. in echt nachzuvollziehen! Keine Sorge, du musst nicht alles selbst machen. Im folgenden findest du zunächst eine Anleitung, wie du dir die notwendige Software installierst. Anschließend kannst du ein bereits vorbereitetes Projekt herunterladen. Einführung in die Bioinformatik Vorbereiten der Software Grundlagen der objektorientierten Programmierung Einfaches Codebeispiel – manipulieren eines strings Referenzieren einzelner Zeichen in einem string Generieren einer zufälligen Aminosäure-Sequenz Scoring von Alignments Prüfen auf…

C#

TCD.Web.NotiConn – communicate between handsets without a server

Two days ago, when I was cycling, suddenly I had the answer: Imagine you have two Windows Phone 7 devices and want to establish a two-way connection between them. For example to play a game of Tic-Tac-Toe. You can do this either with a server on the internet, that connects the clients with each other, or the multicast protocol on WiFi-networks. The same WiFi network may not always be available to both users, but you don’t want to set up a server either (maybe, because you’re only doing this for fun, or you don’t have the resources). The only way to send messages to a WP7 app via the internet is to use push notifications. But how do you exchange the channel addresses between the devices? One way is to use a QR code: Establish a push notification channel on both devices Encode the channel URI into a QR code…

C#

TCD.Mathematics

UPDATE: Source and samples for WinRT and WPF are now on GitHub: https://github.com/michaelosthege/TCD.Mathematics This is just a quick post to introduce you to TCD.Mathematics, which is a NuGet package that adds several extension methods to the System.Windows.Media.Media3D namespace. If you’re unfamiliar with this namespace, it contains Point3D, Vector3D, Line3D and Plane3D classes which can be used for three-dimensional calculations. EDIT: I just submitted an update to the NuGet package, wich adds support for WinRT. Please not that WinRT does not have neither Point3D, Vector3D, nor the System.Windows.Media.Media3D namespace. So in WinRT all classes, including substitutes for Point3D/Vector3D are located under TCD.Mathematics. EDIT: Since version 1.2.0 TCD.Mathematics is a Portable Class Library that targets everything: Silverlight 4+, .NET4+, .NET for Windows Store, Windows Phone 7+, Xbox360 – make sure you’re running version 2.1+ of NuGet Package Manager! The extension methods, which are added to the mentioned Point3D/Vector3D classes are: Vector3D.AsPoint3D() Point3D.AsVector3D() Vector3D.Normalized() Point3D.CenterOfClusterWithOtherPoint3Ds () Point3D.ProjectOnLine3D() Point3D…

C#

TCD.Kinect

EDIT: If you’re interested in Skeleton tracking and calculating 3D stuff, take a look at TCD.Mathematics too^^ EDIT: There’s a WPF application that I once wrote, featuring SkeletonPainter3D: Kinect Sword. There’s a Youtube video of it (http://youtu.be/2j6GCd4M1bA) and that’s the source code: http://dl.dropbox.com/u/7813771/Blog/CodeSamples/KinectSword.zip   Hello there, I’ve created another UserControl, this time for Kinect and .NET 4.5, which hopefully has the potential to save you a lot of time. It can be used to draw three-dimensional Skeletons and explore the virtual space around them in real-time. A picture may be more appropriate: The control can be constructed in XAML: xmlns:kinect=”clr-namespace:TCD.Kinect.Controls;assembly=TCD.Kinect.Controls” <kinect:SkeletonPainter3D x:Name=”painter” Background=”Black” IsAnaglyphEnabled=”False” CameraFieldOfView=”70″ CameraPosition=”0,0.5,-1″ CameraLookAt=”0,0,2″ /> And populated with Skeletons using painter.Draw(skeletons), where skeletons is an Skeleton[] from inside the SkeletonFrameReady event. You can either get the TCD.Kinect package from NuGet, or refer to the sample implementation: http://code.msdn.microsoft.com/Implementation-of-f175b025 Let me know if you have any questions or suggestions, and by the way: SkeletonPainter3D has an experimental…

C#

Windows 8 TouchInjection with C#

The Windows 8 platform provides an API to inject touch events (WM_TOUCH..) via a C++ API. The API is relatively easy to use, but not available in C#, unless you do DllImport/PInvoke. I found this to be kind of tricky, but finally I succeeded to make a C# library that can be used to use the TouchInjection API from C#. You can find TCD.System.TouchInjection on NuGet, or have a look at the TouchInjection.cs file itself. You may notice that I renamed all the strucs, enums and classes to look nicer than their C++ counterparts. The IntelliSense descriptions are available for almost everything! (I got them from the documentation on msdn..) I’ve made a sample application for the MSDN Code Gallery as well. Here’s a small collection of useful resources regarding the TouchInjection API: C++ sample application C++ TouchInjection API walkthrough

C#

TCD.Controls

This is a summary and manual for all controls inside the TCD.Controls package. I’ll try to keep it updated. Windows 8 SilentTextBox – If AcceptsReturn=False and the user hits Enter normal TextBoxes make a ‘bling’ sound. SilentTextBox does not. HeaderedTextBox – A TextBox with a grey header above HeaderedTextBlock – A TextBlock with a grey header above; Automatically hides itself if the Text property is empty (unless AutoHide is set to False). LabeledProgressBar – a ProgressBar coupled with a TextBlock/Label; use it at the top of your page to indicate background progress (like the SystemTray.ProgressBar on Windows Phone) LayoutAwarePage – same as in all the samples Flyout – most recent post and how to use on Flyout SettingsContractWrapper – the easy way to integrate with the settings contract   Windows Phone CustomMessageBox – Async CustomMessageBox on Windows Phone ReverseAutocompletePopup – Making a reverse Autocomplete-TextBox on Windows Phone

C#

TCD.Device

Just another TCD namespace: TCD.Device. Its purpose is to contain additional namespaces that use features like Camera, GPS, Accelerometer, Compass.. Everything that has an effect on the App permissions the user sees on the Windows Phone or Windows 8 application. (Like ‘This app has access to your location, compass..’) TCD.Device.Camera CodeScannerPopup is another async control, specific to the Windows Phone platform, that can be used to scan for QR codes. (In theory other 2D-codes as well.) Usage: add the TCD.Device.Camera NuGet package add using directives for TCD.Device.Camera and TCD.Device.Camera.Barcodes in the calling method (eg. a Button.Click event) hide/show ApplicationBar, attach/remove BackKeyPress event Code sample: private async void Button_Click(object sender, RoutedEventArgs e) { CodeScannerPopup scp = new CodeScannerPopup(Microsoft.Phone.Shell.SystemTray.IsVisible, Format.ALL_1D); //important: hide ApplicationBar and handle BackKeyPress ApplicationBar.IsVisible = false; this.BackKeyPress += scp.HandleBackKeyPress; //now let’s go ScanResult r = await scp.ShowAsync(“BARCODE SCANNER”, “scan”); if (r != null) output.Text = string.Format(“{0}n{1}”, r.Text, r.Format.ToString()); //clean…

C#

TCD.Controls – Flyouts for XAML/C#

Hey there, Let’s start with the most important news: TCD.Controls is now available on NuGet (click here if you don’t know how this works, or why you want to use it) From now on, I won’t link *.zip packages with the sources anymore, because NuGet really make life easier. If you want access to the source files, just drop me an email There’s been one more or less important change to the Flyout control you should know about: It now has a property called “IsIgnoreLightDismissal”. To understand its purpose, imagine the following scenario (video below) You have a Button control that opens a FilePicker/FolderPicker, asking the user to select a File/Folder. This Button is hosted inside a Flyout control. Now when the user taps the Button, the Picker will popup, stealing the focus from your applications Window. Flyouts are required to hide on App-switch by the design guidelines, which is…

C#

Exploring NuGet

Since 5 hours now, I ‘m on NuGet and I’d like to share my first experiences. Why did I join NuGet? I joined NuGet, because it seems to be the most comfortable way to share libraries, containing XAML controls. Share them between my own projects, as well as with you. Previously I always had to include the project containing the controls in the solution I was working on, which was really annoying.. How can you use it? Let’s assume that you want to use a package in your project. All you need is the NuGet Package Manager Visual Studio extension. You can install it via Tools/Extensions and Updates. To use/reference a package from NuGet right-click on the references in the solution explorer and select ‘Manage NuGet Packages’. Then you can search for the package you desire (for example ‘TCD.Serialization’) and add it to your project. How do I use it?…