-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2475 expression profile from pksim (#2476)
* #784_expression_profile_from_pksim * updating with mapper * Fixes #2475 Create expression profile from PK-sim * add dimensions as resource for tests * Add pkparameters for test project * add sqlite db * PR feedback
- Loading branch information
1 parent
da87629
commit d55d807
Showing
42 changed files
with
397 additions
and
917 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
using System.Globalization; | ||
using System.Threading; | ||
using OSPSuite.Assets; | ||
using OSPSuite.Core.Commands.Core; | ||
using OSPSuite.Core.Journal; | ||
using OSPSuite.Core.Services; | ||
using OSPSuite.Infrastructure.Import.Services; | ||
using OSPSuite.Presentation; | ||
using OSPSuite.Presentation.Core; | ||
using OSPSuite.Presentation.DTO; | ||
using OSPSuite.Presentation.Services; | ||
using OSPSuite.Presentation.Views; | ||
using OSPSuite.UI.Mappers; | ||
using OSPSuite.UI.Services; | ||
using OSPSuite.Utility.Container; | ||
using OSPSuite.Utility.Exceptions; | ||
using PKSim.CLI.Core.MinimalImplementations; | ||
using PKSim.Core; | ||
using PKSim.Core.Services; | ||
using PKSim.Infrastructure; | ||
using PKSim.Presentation; | ||
using PKSim.Presentation.DTO.Mappers; | ||
using PKSim.Presentation.Presenters.ExpressionProfiles; | ||
using PKSim.Presentation.Services; | ||
using PKSim.Presentation.Views.ExpressionProfiles; | ||
using PKSim.UI.Views.ExpressionProfiles; | ||
|
||
namespace PKSim.UI.Starter | ||
{ | ||
public static class ApplicationStartup | ||
{ | ||
static IContainer _container; | ||
|
||
public static IContainer Initialize(IShell shell) | ||
{ | ||
if (_container != null) | ||
return _container; | ||
|
||
_container = initializeForStartup(shell); | ||
|
||
return _container; | ||
} | ||
|
||
private static IContainer initializeForStartup(IShell shell) | ||
{ | ||
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); | ||
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en"); | ||
ApplicationIcons.DefaultIcon = ApplicationIcons.PKSim; | ||
|
||
|
||
var container = InfrastructureRegister.Initialize(registerContainerAsStatic: false); | ||
container.RegisterImplementationOf(SynchronizationContext.Current); | ||
|
||
container.Register<IApplicationController, ApplicationController>(LifeStyle.Singleton); | ||
container.Register<ICoreWorkspace, OSPSuite.Core.IWorkspace, IWorkspace, Workspace>(LifeStyle.Singleton); | ||
|
||
// registerImplementationsFromCore(container); | ||
registerMinimalImplementations(container); | ||
|
||
|
||
using (container.OptimizeDependencyResolution()) | ||
{ | ||
container.RegisterImplementationOf(shell); | ||
container.AddRegister(x => x.FromType<CoreRegister>()); | ||
container.AddRegister(x => x.FromType<InfrastructureRegister>()); | ||
container.Register<ICreateExpressionProfilePresenter, CreateExpressionProfilePresenter>(); | ||
container.Register<ICreateExpressionProfileView, CreateExpressionProfileView>(); | ||
container.Register<IExpressionProfileToExpressionProfileDTOMapper, ExpressionProfileToExpressionProfileDTOMapper>(); | ||
container.Register<IMoleculePropertiesMapper, MoleculePropertiesMapper>(); | ||
container.Register<ICoreUserSettings, IPresentationUserSettings, UIStarterUserSettings>(LifeStyle.Singleton); | ||
container.Register<IOntogenyTask, OntogenyTask>(); | ||
container.Register<IEntityTask, EntityTask>(); | ||
container.Register<IRenameObjectDTOFactory, RenameObjectDTOFactory>(); | ||
container.Register<IHistoryManager, HistoryManager<IExecutionContext>>(); | ||
InfrastructureRegister.LoadSerializers(container); | ||
} | ||
|
||
return container; | ||
} | ||
|
||
// /// <summary> | ||
// /// Use this method to register all dependencies in Core.UI and Core.Presentation | ||
// /// </summary> | ||
// private static void registerImplementationsFromCore(IContainer container) | ||
// { | ||
// container.Register<IExceptionManager, ExceptionManager>(LifeStyle.Singleton); | ||
// container.AddRegister(x => x.FromType<UIRegister>()); | ||
// container.AddRegister(x => x.FromType<OSPSuite.Presentation.PresenterRegister>()); | ||
// } | ||
|
||
/// <summary> | ||
/// Use this method to register and refine the minimal implementations for dependencies | ||
/// </summary> | ||
private static void registerMinimalImplementations(IContainer container) | ||
{ | ||
container.Register<IMRUProvider, MRUProvider>(); | ||
container.Register<IImageListRetriever, ImageListRetriever>(); | ||
container.Register<IApplicationIconsToImageCollectionMapper, ApplicationIconsToImageCollectionMapper>(); | ||
container.Register<IDisplayUnitRetriever, CLIDisplayUnitRetriever>(); | ||
container.Register<IExceptionManager, CLIExceptionManager>(); | ||
container.Register<IDialogCreator, CLIDialogCreator>(); | ||
container.Register<IDataImporter, CLIDataImporter>(); | ||
container.Register<IJournalDiagramManagerFactory, CLIJournalDiagramManagerFactory>(); | ||
} | ||
} | ||
|
||
internal class Workspace : CLIWorkspace, IWorkspace | ||
{ | ||
public Workspace(IRegistrationTask registrationTask) : base(registrationTask) | ||
{ | ||
} | ||
|
||
public IWorkspaceLayout WorkspaceLayout { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using OSPSuite.Core.Commands.Core; | ||
using OSPSuite.Presentation.Views; | ||
using PKSim.Core.Mappers; | ||
using PKSim.Core.Model; | ||
using PKSim.Presentation; | ||
using PKSim.Presentation.Presenters.ExpressionProfiles; | ||
|
||
namespace PKSim.UI.Starter | ||
{ | ||
public static class ExpressionProfileCreator | ||
{ | ||
public static object CreateIndividualEnzymeExpressionProfile(IShell shell) | ||
{ | ||
return createExpressionProfile<IndividualEnzyme>(shell); | ||
} | ||
|
||
public static object CreateTransporterExpressionProfile(IShell shell) | ||
{ | ||
return createExpressionProfile<IndividualTransporter>(shell); | ||
} | ||
|
||
public static object CreateBindingPartnerExpressionProfile(IShell shell) | ||
{ | ||
return createExpressionProfile<IndividualOtherProtein>(shell); | ||
} | ||
|
||
private static object createExpressionProfile<T>(IShell shell) where T : IndividualMolecule | ||
{ | ||
var container = ApplicationStartup.Initialize(shell); | ||
|
||
using (var presenter = container.Resolve<ICreateExpressionProfilePresenter>()) | ||
{ | ||
var workspace = container.Resolve<IWorkspace>(); | ||
workspace.Project = new PKSimProject(); | ||
var mapper = container.Resolve<IExpressionProfileToExpressionProfileBuildingBlockMapper>(); | ||
|
||
|
||
return presenter.Create<T>().IsEmpty() ? null : mapper.MapFrom(presenter.ExpressionProfile); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> | ||
<Version>11.1.0</Version> | ||
<AssemblyVersion>11.1.0</AssemblyVersion> | ||
<FileVersion>11.1.0</FileVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\PKSim.CLI.Core\PKSim.CLI.Core.csproj"> | ||
<CopyLocalSatelliteAssemblies></CopyLocalSatelliteAssemblies> | ||
<Private></Private> | ||
</ProjectReference> | ||
<ProjectReference Include="..\PKSim.UI\PKSim.UI.csproj"> | ||
<Private></Private> | ||
<CopyLocalSatelliteAssemblies></CopyLocalSatelliteAssemblies> | ||
</ProjectReference> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.